Skip to content

Fix: Enable exception mode to skip scripts on first error#1258

Closed
glensc wants to merge 2 commits intodanger:mainfrom
glensc:scripts-exceptions
Closed

Fix: Enable exception mode to skip scripts on first error#1258
glensc wants to merge 2 commits intodanger:mainfrom
glensc:scripts-exceptions

Conversation

@glensc
Copy link
Copy Markdown
Contributor

@glensc glensc commented Mar 18, 2022

Replaces #1254

Noticed that "danger:prepush" ran commands with ";" rather "&&" meaning the next command is still executed if the previous one failed. This resulted in very weird errors due to the previous step failure.

Now, aborts of first error:

➜ yarn danger:prepush
yarn run v1.22.17
$ set -e; yarn build:fast; yarn test:fixtures; node distribution/commands/danger.js local --base main --dangerfile dangerfile.lite.ts
$ tsc -p tsconfig.production.json
source/commands/ci/runner.ts:70:30 - error TS2339: Property 'publishCheck' does not exist on type 'SharedCLI'.
...
➜ 

@orta
Copy link
Copy Markdown
Member

orta commented Mar 29, 2022

I'm wary about this breaking on Windows - have you tried it there? The CI doesn't look to be running any of these commands

@glensc
Copy link
Copy Markdown
Contributor Author

glensc commented Mar 29, 2022

Using "; " separator is not new. Some scripts already used those. And I do not have any windows platform access.

@glensc
Copy link
Copy Markdown
Contributor Author

glensc commented May 3, 2022

Same problem in other projects in this organization:

@Jimimaku

This comment was marked as duplicate.

@glensc

This comment was marked as off-topic.

@fbartho

This comment was marked as off-topic.

@glensc
Copy link
Copy Markdown
Contributor Author

glensc commented Apr 12, 2026

Some of the scripts were fixed by random pr's (unrelated pr: #1486):

@glensc
Copy link
Copy Markdown
Contributor Author

glensc commented Apr 12, 2026

Using && then:

@glensc glensc closed this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants