Merge pull request #304 from spotify/rugvip/cli-helpers
cli: add helpers for running child processes and error handling in commands
This commit is contained in:
@@ -62,6 +62,9 @@ function print(msg) {
|
||||
}
|
||||
|
||||
async function waitForExit(child) {
|
||||
if (child.exitCode !== null) {
|
||||
throw new Error(`Child already exited with code ${child.exitCode}`);
|
||||
}
|
||||
await new Promise((resolve, reject) =>
|
||||
child.once('exit', code => {
|
||||
if (code) {
|
||||
|
||||
Reference in New Issue
Block a user