MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / executeCommand

Function executeCommand

packages/hydrooj/src/ui.ts:24–39  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

22
23const shell = new Logger('shell');
24async 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
41let readlineCallback;
42

Callers 1

ui.tsFile · 0.85

Calls 2

infoMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected