Add shell and echo app
This commit is contained in:
23
test-hdd/apps/tysh/index.js
Normal file
23
test-hdd/apps/tysh/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
__oskrnl.console_log("> ");
|
||||
|
||||
var input = "";
|
||||
var inputActive = true;
|
||||
|
||||
__oskrnl.input_onKeyPress(function (key) {
|
||||
if (!inputActive) return;
|
||||
|
||||
if (key == "Backspace") input = input.slice(0, -1);
|
||||
else if (key == "Enter") {
|
||||
inputActive = false;
|
||||
process();
|
||||
return;
|
||||
} else input += key.toLowerCase();
|
||||
|
||||
__oskrnl.console_update("> " + input);
|
||||
});
|
||||
|
||||
function process() {
|
||||
var app = input.split(" ")[0];
|
||||
var args = input.split(" ").slice(1);
|
||||
__oskrnl.app_launcher_run(app, args.join(" "));
|
||||
}
|
||||
5
test-hdd/apps/tysh/meta.lam
Normal file
5
test-hdd/apps/tysh/meta.lam
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"app:name": "tysh",
|
||||
"app:version": "1.0.0",
|
||||
"app:entrypoint": "index.js"
|
||||
}
|
||||
Reference in New Issue
Block a user