Skip to content

Commit

Permalink
Ensure that child build processes started when running on Windows exi…
Browse files Browse the repository at this point in the history
…t properly. (#1022)

plugin-run-script and plugin-build script use execa.command with the shell: true
option set to execute the user's command.  On Windows, this causes the child process
to remain running after Snowpack exits: sindresorhus/execa#433.
The fix is to override the default windowsHide option -- as Snowpack always runs from
a console we don't actually need execa to hide any extra console windows for us.
  • Loading branch information
pkaminski committed Sep 11, 2020
1 parent d771829 commit 1667143
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/plugin-build-script/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function buildScriptPlugin(_, {input, output, cmd}) {
env: npmRunPath.env(),
extendEnv: true,
shell: true,
windowsHide: false,
input: contents,
cwd,
});
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-run-script/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function runScriptPlugin(_, {cmd, watch, output}) {
env: npmRunPath.env(),
extendEnv: true,
shell: true,
windowsHide: false,
cwd,
});
const {stdout, stderr} = workerPromise;
Expand Down

1 comment on commit 1667143

@vercel
Copy link

@vercel vercel bot commented on 1667143 Sep 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.