Reputation: 2394
I have an npm script where one of the commands, in this case, the test
script, can fail.
"test": "npm run init && npm run test && npm run end"
If the test
script fails the end
script is never executed.
Is there a way to force the execution of the end
script even if test
fails?
Thanks!
Upvotes: 2
Views: 2888
Reputation: 19597
Use ;
control operator:
npm run init ; npm run test ; npm run end
;
means execute the preceding statement and, after it completes, proceed to the next statement.
Upvotes: 6