Skip to content

Commit

Permalink
fix: resolve promises for processes with nonzero exit code if nullOnE…
Browse files Browse the repository at this point in the history
…rror is enabled
  • Loading branch information
themightychris committed May 28, 2019
1 parent de18291 commit 6e0aedb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Hab.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class Hab {
if (execOptions.wait) {
return new Promise((resolve, reject) => {
process.on('exit', code => {
if (code == 0) {
if (code == 0 || execOptions.nullOnError) {
resolve();
} else {
reject(code);
Expand All @@ -263,7 +263,7 @@ class Hab {
});

process.on('exit', code => {
if (code == 0) {
if (code == 0 || execOptions.nullOnError) {
resolve(output);
} else {
reject({ output, code });
Expand Down

0 comments on commit 6e0aedb

Please sign in to comment.