diff --git a/packages/solo/src/entrypoint.cjs b/packages/solo/src/entrypoint.cjs index 4ac5b5ae305..2275e314648 100755 --- a/packages/solo/src/entrypoint.cjs +++ b/packages/solo/src/entrypoint.cjs @@ -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(`\ diff --git a/packages/solo/src/main.js b/packages/solo/src/main.js index 6fc8a95e1f0..e3614a99c39 100644 --- a/packages/solo/src/main.js +++ b/packages/solo/src/main.js @@ -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)]); @@ -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; }