Skip to content

Commit

Permalink
Prevents exiting the process on sigint through yarn-path (#7957)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed Mar 6, 2020
1 parent 2cb2fc4 commit 4bb38a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cli/index.js
Expand Up @@ -629,6 +629,11 @@ async function start(): Promise<void> {
const opts = {stdio: 'inherit', env: Object.assign({}, process.env, {YARN_IGNORE_PATH: 1})};
let exitCode = 0;

process.on(`SIGINT`, () => {
// We don't want SIGINT to kill our process; we want it to kill the
// innermost process, whose end will cause our own to exit.
});

try {
if (yarnPath.endsWith(`.js`)) {
exitCode = await spawnp(process.execPath, [yarnPath, ...argv], opts);
Expand Down

0 comments on commit 4bb38a1

Please sign in to comment.