Skip to content

Commit

Permalink
Add semi-working uname unix commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsLap committed Jul 19, 2024
1 parent c5f17bd commit b7823ec
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion pkgs/apps/Terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ export default {
pwd Print the current directory
rm [file] Delete a file
rmdir [dir] Delete a directory
touch [file] Create a file<br>`
touch [file] Create a file
uname <br>`
);
break;
case "clear":
Expand Down Expand Up @@ -354,6 +355,66 @@ export default {
let file3 = argsStr.trim();
await vfs.writeFile(path + "/" + file3, "");
break;
case "uname":
console.log(Root);
let KernelName = "Pluto-Core";
let HostName = window.location.hostname;
let KernelRelease = Root.Lib.systemInfo.version + " Browser";
let KernelVersion =
"#1 " +
Root.Lib.systemInfo.codename +
" " +
Root.Lib.systemInfo.version;
let Machine = "Browser";
let OsName = "Pluto";
let args2 = argsStr.trim();
switch (args2) {
case "-a":
appendOutput(
`${KernelName} ${HostName} ${KernelRelease} ${KernelVersion} ${Machine} ${OsName}`
);
break;
case "-s":
appendOutput(`${KernelName}`);
break;
case "-n":
appendOutput(`${HostName}`);
break;
case "-r":
appendOutput(`${KernelRelease}`);
break;
case "-v":
appendOutput(`${KernelVersion}`);
break;
case "-m":
appendOutput(`${Machine}`);
break;
case "-o":
appendOutput(`${OsName}`);
break;
case "-p":
appendOutput(`${Machine}`);
break;
case "-u":
appendOutput(`${navigator.userAgent}`);
break;
default:
appendOutput(
`uname: invalid option ${args2}
usage: uname [OPTION]
uname -a List all information
uname -s Kernel name
uname -n Host name
uname -r Kernel release
uname -v Kernel version
uname -m Machine
uname -o OS name
uname -p Machine
uname -u User agent`
);
break;
}
break;
default:
if (cmd !== "") {
console.log(cmd);
Expand Down Expand Up @@ -383,6 +444,7 @@ export default {
pid: Root.PID,
});
}
break;
}
}
document.querySelector(".no-ui").scrollTop =
Expand Down

0 comments on commit b7823ec

Please sign in to comment.