Skip to content

Commit

Permalink
Falls back to default shell to install plugin on win32 (#1565)
Browse files Browse the repository at this point in the history
- related to #1480
  • Loading branch information
kwonoj authored and rauchg committed Feb 27, 2017
1 parent 36f96ab commit 3df8274
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions app/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,20 @@ function install(fn) {
};
// determine the shell we're running in
const whichShell = (typeof cfgShell === 'string' && cfgShell.match(/fish/)) ? 'fish' : 'posix';
// Use the install command that is appropriate for our shell
exec(installCommands[whichShell], {
const execOptions = {
cwd: path,
env,
shell
}, err => {
env
};

// https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
// node.js requires command line parsing should be compatible with cmd.exe on Windows, should able to accept `/d /s /c`
// but most custom shell doesn't. Instead, falls back to default shell
if (process.platform !== 'win32') {
execOptions.shell = shell;
}

// Use the install command that is appropriate for our shell
exec(installCommands[whichShell], execOptions, err => {
if (err) {
return fn(err);
}
Expand Down

0 comments on commit 3df8274

Please sign in to comment.