Skip to content

Commit

Permalink
Fix: Add a workaround for Git Bash for Windows (fixes #24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Mar 12, 2016
1 parent 262d244 commit c4a86da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/bin/npm-run-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@ if (require.main === module) {
const promise = main(process.argv.slice(2), process.stdout, process.stderr);

// Error Handling.
promise.catch(err => {
console.error("ERROR:", err.message); // eslint-disable-line no-console
process.exit(1);
});
promise.then(
() => {
// I'm not sure why, but maybe the process never exits on Git Bash (MINGW64)
process.exit(0);
},
(err) => {
console.error("ERROR:", err.message); // eslint-disable-line no-console
process.exit(1);
}
);
}
3 changes: 2 additions & 1 deletion src/lib/run-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import spawn from "./spawn";
function detectStreamKind(stream, std) {
return (
stream == null ? "ignore" :
stream !== std ? "pipe" :
// `|| !std.isTTY` is needed for the workaround of https://github.com/nodejs/node/issues/5620
stream !== std || !std.isTTY ? "pipe" :
/* else */ stream
);
}
Expand Down

0 comments on commit c4a86da

Please sign in to comment.