Skip to content

Commit

Permalink
fix(solo): propagate exit status
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed May 2, 2021
1 parent 5e236e6 commit 1f6537e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/solo/src/entrypoint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const solo = esmRequire('./main.js').default;

const baseprog = path.basename(process.argv[1]);
solo(baseprog, process.argv.slice(2)).then(
_res => 0,
res => process.exit(res || 0),
reason => {
console.log(`error running ag-solo:`, reason);
console.error(`\
Expand Down
6 changes: 4 additions & 2 deletions packages/solo/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ start
const { netconfig } = parseArgs(argv.slice(1));
if (!AG_SOLO_BASEDIR) {
console.error(`setup: you must set $AG_SOLO_BASEDIR`);
return;
return 1;
}
if (!fs.existsSync(AG_SOLO_BASEDIR)) {
await solo(progname, ['init', AG_SOLO_BASEDIR, ...argv.slice(1)]);
Expand Down Expand Up @@ -145,11 +145,13 @@ start
const cp = spawnSync(`${__dirname}/../../${argv[0]}.js`, argv.slice(1), {
stdio: 'inherit',
});
process.exit(cp.status);
return cp.status;
}
default: {
log.error(`unrecognized command ${argv[0]}`);
log.error(`try one of: init, set-gci-ingress, start`);
return 1;
}
}
return 0;
}

0 comments on commit 1f6537e

Please sign in to comment.