Skip to content

Commit

Permalink
display exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Nov 24, 2023
1 parent c27786b commit b4cbaf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/runEslint.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { execa } from 'execa';
// eslint-disable-next-line unicorn/prefer-top-level-await
execa('eslint --exit-on-fatal-error test/test.ts', { stdio: 'inherit' }).catch((error) => {
process.exitCode = error.exitCode === 1 ? 0 : 1;
const exitCode = error.exitCode === 1 ? 0 : 1;
console.log(`Exiting with exit code: ${exitCode}`);
process.exitCode = exitCode;
});
6 changes: 5 additions & 1 deletion test/runEslint.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { execa } from 'execa'
// eslint-disable-next-line unicorn/prefer-top-level-await
execa('eslint --exit-on-fatal-error test/test.ts', { stdio: 'inherit' }).catch(
(error) => {
process.exitCode = error.exitCode === 1 ? 0 : 1
const exitCode = error.exitCode === 1 ? 0 : 1

console.log(`Exiting with exit code: ${exitCode}`)

process.exitCode = exitCode
}
)

0 comments on commit b4cbaf5

Please sign in to comment.