(input: string)
| 22 | |
| 23 | const shell = new Logger('shell'); |
| 24 | async function executeCommand(input: string) { |
| 25 | // Clear the stack |
| 26 | setImmediate(async () => { |
| 27 | if (input === 'exit' || input === 'quit' || input === 'shutdown') { |
| 28 | return process.kill(process.pid, 'SIGINT'); |
| 29 | } |
| 30 | if (process.stdin.isRaw) return false; |
| 31 | try { |
| 32 | // eslint-disable-next-line no-eval |
| 33 | shell.info(await eval(input)); |
| 34 | } catch (e) { |
| 35 | shell.warn(e); |
| 36 | } |
| 37 | return true; |
| 38 | }); |
| 39 | } |
| 40 | |
| 41 | let readlineCallback; |
| 42 |