MCPcopy
hub / github.com/shelljs/shelljs / runExitInSubprocess

Function runExitInSubprocess

test/exit.js:11–20  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

9//
10
11function runExitInSubprocess(code) {
12 const script = code !== undefined
13 ? `var shell = require("."); shell.exit(${code});`
14 : 'var shell = require("."); shell.exit();';
15 const result = shell.exec(
16 `${JSON.stringify(shell.config.execPath)} -e ${JSON.stringify(script)}`
17 );
18 const actualReturnCode = result.code;
19 return actualReturnCode;
20}
21
22test('exit with success status code', t => {
23 t.is(runExitInSubprocess(0), 0);

Callers 1

exit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…