From 7923aa8942b55884320ef2428417e3ee4b121613 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 28 Nov 2022 17:31:34 +0100 Subject: Initial commit --- Components/InternalShell/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Components/InternalShell/index.js (limited to 'Components/InternalShell/index.js') diff --git a/Components/InternalShell/index.js b/Components/InternalShell/index.js new file mode 100644 index 0000000..682da6e --- /dev/null +++ b/Components/InternalShell/index.js @@ -0,0 +1,14 @@ +const child_process = require("child_process"); +global.log = require('../../MistyCore/log'); + +module.exports = (arguments) => { + let args = []; + + if (arguments['_finals'].length > 0) { + args = [ "-c", arguments['_finals'].join(" ") ]; + } + + log("Shell-InternalShell", "Starting internal shell"); + child_process.execFileSync("/System/Binaries/sh", args, { stdio: "inherit" }); + log("Shell-InternalShell", "Stopped internal shell"); +} \ No newline at end of file -- cgit