From 93b488ac598c3cc7b01a2fbc004c4a50c6d7b559 Mon Sep 17 00:00:00 2001 From: Jeremy Judeaux Date: Thu, 27 Jul 2017 14:20:25 +0800 Subject: [PATCH] Fix yarn run on windows, use shell option from child_process.spawn --- src/util/execute-lifecycle-script.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/util/execute-lifecycle-script.js b/src/util/execute-lifecycle-script.js index bdfe09dae9..8f05b5faba 100644 --- a/src/util/execute-lifecycle-script.js +++ b/src/util/execute-lifecycle-script.js @@ -166,23 +166,9 @@ export async function executeLifecycleScript( env[constants.ENV_PATH_KEY] = pathParts.join(path.delimiter); // get shell - const conf = {windowsVerbatimArguments: false}; - let sh = 'sh'; - let shFlag = '-c'; if (process.platform === 'win32') { - // cmd or command.com - sh = process.env.comspec || 'cmd'; - - // d - Ignore registry AutoRun commands - // s - Strip " quote characters from command. - // c - Run Command and then terminate - shFlag = '/d /s /c'; - // handle windows run scripts starting with a relative path cmd = fixCmdWinSlashes(cmd); - - // handle quotes properly in windows environments - https://github.com/nodejs/node/issues/5060 - conf.windowsVerbatimArguments = true; } let updateProgress; @@ -204,7 +190,7 @@ export async function executeLifecycleScript( } }; } - const stdout = await child.spawn(sh, [shFlag, cmd], {cwd, env, stdio, ...conf}, updateProgress); + const stdout = await child.spawn(cmd, [], {shell: true, cwd, env, stdio}, updateProgress); return {cwd, command: cmd, stdout}; }