From b4a497abe27d5427be8080613e7785046f2591e0 Mon Sep 17 00:00:00 2001 From: dreuxl Date: Fri, 4 Dec 2020 09:02:19 -0800 Subject: [PATCH] windows support --- lib/retry.js | 4 ++-- package-lock.json | 41 +++++++++++++++++++++++++++++++++++++++-- package.json | 1 + 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/lib/retry.js b/lib/retry.js index 6581440..a666f26 100644 --- a/lib/retry.js +++ b/lib/retry.js @@ -14,7 +14,7 @@ var xml2js = require('xml2js'); var argv = require('yargs').argv; var debug = require('debug')('ProtractorRetry'); var unique = require('array-unique'); -var childProcess = require('child_process'); +var crossSpawn = require('cross-spawn'); var Q = require('q'); var retry; @@ -155,7 +155,7 @@ function spawn(command, args) { debug('Command', command, args); return function() { return Q.Promise(function(resolve) { - var child = childProcess.spawn(command, args); + var child = crossSpawn(command, args); child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); child.on('close', (code) => { diff --git a/package-lock.json b/package-lock.json index 97d3737..5c9f975 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1002,6 +1002,44 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -2778,8 +2816,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isstream": { "version": "0.1.2", diff --git a/package.json b/package.json index bcf07e4..1bc9a6d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "array-unique": "~0.3.2", "chai": "3.x", "chai-as-promised": "5.x", + "cross-spawn": "^7.0.2", "debug": "^2.1.1", "lodash": "^4.17.19", "mkdirp": "^0.5.1",