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

Exit with error code when errors are caught. #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JMTyler
Copy link

@JMTyler JMTyler commented May 10, 2019

If errors occur during build, vitreum exits with a success code of 0, which doesn't tell NPM that anything went wrong.

If we change to exit with an error code of 1, it helps to make it a little more clear that something went wrong by giving us the classic NPM error output at the end:

THERE ARE ERRORS
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vitreum --static`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jaredtyler/.npm/_logs/2019-05-10T19_07_02_845Z-debug.log

@stolksdorf
Copy link
Owner

ooo good catch. I think I left a 0 error code in there so that an error during the dev step wouldn't exit out of the nodemon process. Lets add something conditional like:

)(args.targets, args)
	.catch((err)=>{
		console.log(err);
		if(args.dev) return process.exit(0);
		process.exit(1);
	})

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.

2 participants