Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix yarn run on window #4031

Merged
merged 1 commit into from
Jul 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/util/execute-lifecycle-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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};
}
Expand Down