MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / waitForProcessExit

Function waitForProcessExit

bin/checkout-pr.js:130–143  ·  view source on GitHub ↗

* Return a promise to be resolved by the child process exit event * @param {ChildProcess} child - Child process

(child)

Source from the content-addressed store, hash-verified

128 * @param {ChildProcess} child - Child process
129 */
130function waitForProcessExit(child) {
131 return new Promise((resolve, reject) => {
132 child.on('exit', (code, signal) => {
133 if (code === 0 || code === 128) resolve(code);
134 else {
135 reject(
136 new Error(
137 `Process ${child.pid} exits with code ${code} signal ${signal}`,
138 ),
139 );
140 }
141 });
142 });
143}
144
145console.log('+-----------------------------------------------+');
146console.log('| Check out GitHub CLI - https://cli.github.com |');

Callers 1

gitFunction · 0.70

Calls 3

resolveFunction · 0.50
rejectFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected