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:
Patrik Oldsberg
2020-03-18 16:07:15 +01:00
committed by GitHub
10 changed files with 151 additions and 55 deletions
+3
View File
@@ -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) {