@vltpkg/run 1.3.7 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -225,9 +225,10 @@ const withShellArgs = (shell, arg0, args) => {
225
225
  * Execute an arbitrary command in the background
226
226
  */
227
227
  export const exec = async (options) => {
228
- const { arg0, args = [], cwd, env = {}, projectRoot, 'script-shell': shell = false, color = false, signal, ...spawnOptions } = options;
228
+ const { arg0, args = [], cwd, env = {}, projectRoot, 'script-shell': shell = false, color = false, ...spawnOptions } = options;
229
229
  const [spawnCmd, spawnArgs] = withShellArgs(shell, arg0, args);
230
230
  const p = promiseSpawn(spawnCmd, spawnArgs, {
231
+ // `signal` kills it when aborted
231
232
  ...spawnOptions,
232
233
  shell,
233
234
  stdio: 'pipe',
@@ -241,6 +242,12 @@ export const exec = async (options) => {
241
242
  windowsHide: true,
242
243
  });
243
244
  proxySignals(p.process);
245
+ // rejected on 'error'; a killed shell's own child would keep these
246
+ // pipes, and so this process, open
247
+ p.process.on('error', () => {
248
+ p.process.stdout.destroy();
249
+ p.process.stderr.destroy();
250
+ });
244
251
  return await p;
245
252
  };
246
253
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/run",
3
3
  "description": "Run package.json scripts and execute commands",
4
- "version": "1.3.7",
4
+ "version": "1.4.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,12 +13,12 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/error-cause": "1.3.7",
17
- "@vltpkg/package-json": "1.3.7",
18
- "@vltpkg/promise-spawn": "1.3.7",
19
- "@vltpkg/types": "1.3.7",
20
- "@vltpkg/user-agent": "1.3.7",
21
- "@vltpkg/xdg": "1.3.7",
16
+ "@vltpkg/error-cause": "1.4.0",
17
+ "@vltpkg/package-json": "1.4.0",
18
+ "@vltpkg/promise-spawn": "1.4.0",
19
+ "@vltpkg/types": "1.4.0",
20
+ "@vltpkg/user-agent": "1.4.0",
21
+ "@vltpkg/xdg": "1.4.0",
22
22
  "foreground-child": "^3.3.1",
23
23
  "walk-up-path": "^4.0.0"
24
24
  },