Add shell option to spawn (#983)
* Bump braces and gulp Bumps [braces](https://github.com/micromatch/braces) to 3.0.3 and updates ancestor dependency [gulp](https://github.com/gulpjs/gulp). These dependencies need to be updated together. Updates `braces` from 3.0.2 to 3.0.3 - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) Updates `gulp` from 4.0.2 to 5.0.0 - [Release notes](https://github.com/gulpjs/gulp/releases) - [Changelog](https://github.com/gulpjs/gulp/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/gulp/compare/v4.0.2...v5.0.0) --- updated-dependencies: - dependency-name: braces dependency-type: indirect - dependency-name: gulp dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ws, engine.io-client and engine.io Bumps [ws](https://github.com/websockets/ws), [engine.io-client](https://github.com/socketio/engine.io-client) and [engine.io](https://github.com/socketio/engine.io). These dependencies needed to be updated together. Updates `ws` from 7.4.6 to 7.5.10 - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/7.4.6...7.5.10) Updates `engine.io-client` from 3.5.2 to 3.5.4 - [Release notes](https://github.com/socketio/engine.io-client/releases) - [Changelog](https://github.com/socketio/engine.io-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/engine.io-client/compare/3.5.2...3.5.4) Updates `engine.io` from 3.6.1 to 3.6.2 - [Release notes](https://github.com/socketio/engine.io/releases) - [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/engine.io/compare/3.6.1...3.6.2) --- updated-dependencies: - dependency-name: ws dependency-type: indirect - dependency-name: engine.io-client dependency-type: indirect - dependency-name: engine.io dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Add shell option to spawn to prevent einvals errors in node * delete shell option for browser platfom * update test error message --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Родитель
86d97d74f3
Коммит
a1ead06d2b
|
@ -91,7 +91,11 @@ export class ChildProcess {
|
|||
options: ISpawnOptions = {},
|
||||
showStdOutputsOnError: boolean = false,
|
||||
): ISpawnResult {
|
||||
const spawnedProcess = this.childProcess.spawn(command, args, options);
|
||||
const spawnedProcess = this.childProcess.spawn(
|
||||
command,
|
||||
args,
|
||||
Object.assign({}, options, { shell: true }),
|
||||
);
|
||||
const outcome: Promise<void> = new Promise((resolve, reject) => {
|
||||
spawnedProcess.once("error", (error: any) => {
|
||||
reject(error);
|
||||
|
|
|
@ -77,6 +77,7 @@ export class CordovaIosDeviceLauncher {
|
|||
CordovaIosDeviceLauncher.nativeDebuggerProxyInstance = child_process.spawn(
|
||||
"idevicedebugserverproxy",
|
||||
[proxyPort.toString()],
|
||||
{ shell: true },
|
||||
);
|
||||
CordovaIosDeviceLauncher.nativeDebuggerProxyInstance.on(
|
||||
"error",
|
||||
|
@ -124,6 +125,7 @@ export class CordovaIosDeviceLauncher {
|
|||
CordovaIosDeviceLauncher.webDebuggerProxyInstance = child_process.spawn(
|
||||
"ios_webkit_debug_proxy",
|
||||
iwdpArgs,
|
||||
{ shell: true },
|
||||
);
|
||||
CordovaIosDeviceLauncher.webDebuggerProxyInstance.on("error", function () {
|
||||
reject(
|
||||
|
@ -275,6 +277,7 @@ export class CordovaIosDeviceLauncher {
|
|||
const imagemounter: child_process.ChildProcess = child_process.spawn(
|
||||
"ideviceimagemounter",
|
||||
[path, `${path}.signature`],
|
||||
{ shell: true },
|
||||
);
|
||||
return new Promise((resolve, reject) => {
|
||||
let stdout = "";
|
||||
|
@ -337,13 +340,11 @@ export class CordovaIosDeviceLauncher {
|
|||
|
||||
// Attempt to find the developer disk image for the appropriate
|
||||
return Promise.all([versionInfo, pathInfo]).then(([version, sdkpath]) => {
|
||||
const find: child_process.ChildProcess = child_process.spawn("find", [
|
||||
sdkpath,
|
||||
"-path",
|
||||
`*${version}*`,
|
||||
"-name",
|
||||
"DeveloperDiskImage.dmg",
|
||||
]);
|
||||
const find: child_process.ChildProcess = child_process.spawn(
|
||||
"find",
|
||||
[sdkpath, "-path", `*${version}*`, "-name", "DeveloperDiskImage.dmg"],
|
||||
{ shell: true },
|
||||
);
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
find.stdout.on("data", function (data: any): void {
|
||||
const dataStr: string = data.toString();
|
||||
|
|
|
@ -26,7 +26,7 @@ export function execCommand(
|
|||
errorLogger: (message: string) => void,
|
||||
): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const proc = child_process.spawn(command, args, { stdio: "pipe" });
|
||||
const proc = child_process.spawn(command, args, { stdio: "pipe", shell: true });
|
||||
let stderr = "";
|
||||
let stdout = "";
|
||||
proc.stderr.on("data", (data: Buffer) => {
|
||||
|
@ -173,7 +173,7 @@ export function cordovaStartCommand(
|
|||
args.push("--no-update-notifier");
|
||||
}
|
||||
|
||||
return child_process.spawn(command, args, { cwd: cordovaRootPath, env });
|
||||
return child_process.spawn(command, args, { cwd: cordovaRootPath, env, shell: true });
|
||||
}
|
||||
|
||||
export function killTree(processId: number): void {
|
||||
|
|
|
@ -201,6 +201,7 @@ export class PluginSimulator implements vscode.Disposable {
|
|||
["install", this.CORDOVA_SIMULATE_PACKAGE, "--verbose", "--no-save"],
|
||||
{
|
||||
cwd: path.dirname(findFileInFolderHierarchy(__dirname, "package.json")),
|
||||
shell: true,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -470,6 +470,7 @@ export class CordovaProjectHelper {
|
|||
...process.env,
|
||||
CI: "Hack to disable Ionic autoupdate prompt",
|
||||
},
|
||||
shell: true,
|
||||
});
|
||||
const parseVersion = /\d+\.\d+\.\d+/.exec(ionicInfo.stdout.toString());
|
||||
return parseVersion[0].trim();
|
||||
|
|
|
@ -23,7 +23,7 @@ suite("commandExecutor", function () {
|
|||
})
|
||||
.catch(err => {
|
||||
console.log(err.message);
|
||||
assert.strictEqual(err.message, "spawn ber ENOENT");
|
||||
assert.strictEqual(err.message, "Error running ber test");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -67,7 +67,7 @@ function existsCaseSensitive(filePath) {
|
|||
}
|
||||
|
||||
function executeCommand(command, args, callback, opts) {
|
||||
const proc = child_process.spawn(command + (process.platform === "win32" ? ".cmd" : ""), args, opts);
|
||||
const proc = child_process.spawn(command + (process.platform === "win32" ? ".cmd" : ""), args, Object.assign({}, opts, { shell: true }));
|
||||
let errorSignaled = false;
|
||||
|
||||
proc.stdout.on("data", (data) => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче