Skip to content

Commit

Permalink
force exit
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrinded committed Nov 8, 2023
1 parent 5a7c5f0 commit 25a52c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-peaches-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonwall/cli": patch
---

Force exit on failure
10 changes: 7 additions & 3 deletions packages/cli/src/cmds/entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ yargs(hideBin(process.argv))
async (args) => {
if (args.envName) {
process.env.MOON_RUN_SCRIPTS = "true";
(await testCmd(args.envName.toString(), { testNamePattern: args.GrepTest }))
? process.exit(0)
: process.exit(1);
if (await testCmd(args.envName.toString(), { testNamePattern: args.GrepTest })) {
console.log("✅ All tests passed");
process.exit(0);
} else {
console.log("❌ Some tests failed");
process.kill(process.pid, 'SIGTERM');
}
} else {
console.log("❌ No environment specified");
console.log(`👉 Run 'pnpm moonwall --help' for more information`);
Expand Down

0 comments on commit 25a52c3

Please sign in to comment.