Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to exit on first error #253

Closed
sheerun opened this issue Nov 11, 2015 · 3 comments
Closed

How to exit on first error #253

sheerun opened this issue Nov 11, 2015 · 3 comments

Comments

@sheerun
Copy link

sheerun commented Nov 11, 2015

Hey,

What is the equivalent of set -e in shelljs?

@nfischer
Copy link
Member

Not sure if this exists yet, although it should be possible to implement. This would involve (among other things) writing a set() command, however. Which options in addition to -e do you think would be most useful to implement?

@nfischer
Copy link
Member

Looks like I spoke too soon. Try config.fatal:

require('shelljs/global');
config.fatal = true;
rm('-f', 'fake_file');
ls('fake_file');
ls('fake_file'); // This is never executed

@nfischer
Copy link
Member

nfischer commented Jan 8, 2016

Closing this, since config.fatal should be good enough for now. We can reopen this if there is more justification for a full-fledged set command that supports more than just the -e/+e option.

@nfischer nfischer closed this as completed Jan 8, 2016
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

No branches or pull requests

2 participants