cross-spawn-cb 0.5.5 → 0.5.9

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.
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  require('./polyfills');
2
2
  module.exports = require('./spawnCallback');
3
3
  module.exports.sync = require('./spawnSyncCallback');
4
- module.exports.pathKey = require('./path-key');
4
+ module.exports.pathKey = require('./path-key').default;
@@ -57,8 +57,7 @@ function invoke(cmd) {
57
57
  return 0;
58
58
  }
59
59
 
60
- module.exports = spawnSyncFallback;
61
- function spawnSyncFallback(cmd, commandArgs, options) {
60
+ module.exports = function spawnSyncFallback(cmd, commandArgs, options) {
62
61
  var args = [];
63
62
  for (var i = 0; i < arguments.length; i++) {
64
63
  args.push(arguments[i]);
@@ -1,12 +1,13 @@
1
+ var assign = require('just-extend');
1
2
  var spawnSync = require('./cross-spawn').sync;
2
3
 
3
4
  module.exports = function spawnSyncCallback(command, args, options) {
4
- options = options || {};
5
-
6
- var result = spawnSync(command, args, {
5
+ var syncOptions = assign({}, options || {}, {
6
+ env: options.env || process.env,
7
7
  stdio: 'pipe',
8
8
  encoding: 'utf-8',
9
9
  });
10
+ var result = spawnSync(command, args, syncOptions);
10
11
  if (result.stdout && (options.stdout === 'inherit' || options.stdio === 'inherit')) {
11
12
  process.stdout.write(result.stdout);
12
13
  result.stdout = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-spawn-cb",
3
- "version": "0.5.5",
3
+ "version": "0.5.9",
4
4
  "description": "Cross spawn with a completion callback",
5
5
  "keywords": [
6
6
  "cross-spawn",
@@ -40,7 +40,7 @@
40
40
  "@rollup/plugin-node-resolve": "^13.3.0",
41
41
  "@typescript-eslint/parser": "^5.30.0",
42
42
  "depcheck": "^1.4.3",
43
- "dis-dat": "^0.1.5",
43
+ "dis-dat": "^0.1.6",
44
44
  "eslint": "^8.18.0",
45
45
  "eslint-config-prettier": "^8.5.0",
46
46
  "eslint-config-standard": "^17.0.0",