Skip to content

Commit

Permalink
Avoid dumping node error when just fails
Browse files Browse the repository at this point in the history
In case of `just` command fails, we should not print
long unnecessary nodejs error but just propagate exit code.

Fixes #6.
  • Loading branch information
sergei-dyshel committed Jul 25, 2024
1 parent 881f9cf commit 40a0e4a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bin/just.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ const ext = process.platform === 'win32' ? '.exe' : '';
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

child_process.execFileSync(
path.resolve(__dirname, 'just' + ext),
process.argv.slice(2),
{ stdio: 'inherit' }
);
try {
child_process.execFileSync(
path.resolve(__dirname, 'just' + ext),
process.argv.slice(2),
{ stdio: 'inherit' }
);
} catch (err) {
if ('status' in err)
exit(err.status);
throw err;
}

0 comments on commit 40a0e4a

Please sign in to comment.