mirror of
https://git.ari.lt/ari.lt/ari.lt.git
synced 2025-02-04 17:49:24 +01:00
update @ Tue 3 May 22:31:48 EEST 2022
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
b8681fd39f
commit
5b03520680
1 changed files with 8 additions and 4 deletions
|
@ -25,9 +25,8 @@ function main() {
|
||||||
case "Enter": {
|
case "Enter": {
|
||||||
if (!cmd_prompt.value) return;
|
if (!cmd_prompt.value) return;
|
||||||
|
|
||||||
|
let is_comment = false;
|
||||||
let command_list = cmd_prompt.value.trimStart().split(" ");
|
let command_list = cmd_prompt.value.trimStart().split(" ");
|
||||||
if (command_list[0][0] == "#") return;
|
|
||||||
|
|
||||||
let command = command_list[0].toLocaleLowerCase();
|
let command = command_list[0].toLocaleLowerCase();
|
||||||
let argv = command_list.slice(1);
|
let argv = command_list.slice(1);
|
||||||
|
|
||||||
|
@ -40,10 +39,15 @@ function main() {
|
||||||
cmd_output.innerHTML = commands[command]["func"](argv);
|
cmd_output.innerHTML = commands[command]["func"](argv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmd_output.innerText = `${command}: command not found`;
|
if (command[0] != "#")
|
||||||
|
cmd_output.innerText = `${command}: command not found`;
|
||||||
|
else is_comment = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd_output.innerHTML.toString().replace(/\s/g, "")) {
|
if (
|
||||||
|
cmd_output.innerHTML.toString().replace(/\s/g, "") ||
|
||||||
|
is_comment
|
||||||
|
) {
|
||||||
let shell_old = document.createElement("pre");
|
let shell_old = document.createElement("pre");
|
||||||
shell_old.setAttribute("class", "shell");
|
shell_old.setAttribute("class", "shell");
|
||||||
shell_old.setAttribute(
|
shell_old.setAttribute(
|
||||||
|
|
Loading…
Add table
Reference in a new issue