Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Move run process logic to location of call.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaridmargolin committed Mar 17, 2017
1 parent 60880d8 commit 98eec4c
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions packages/neutrino/bin/neutrino
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,12 @@ function run(command, args) {
// Also grab any Neutrino config from package.json and merge it into the config at a higher precedence
api.use(() => api.config.merge(config));

if (args.inspect) {
return inspect(api.getWebpackOptions());
}

api[command](args)
.then(() => process.exit(0))
.catch(err => {
if (err) {
console.error(err);
}

process.exit(1);
});
return args.inspect ?
inspect(api.getWebpackOptions()) :
api[command](args);
}

run(args._[0], args);
run(args._[0], args).catch((err) => {
console.error(err || `Error during ${args._[0]}`);
process.exit(1);
});

0 comments on commit 98eec4c

Please sign in to comment.