From 3198a90823372c2e71f2d8a3de06628b05681c59 Mon Sep 17 00:00:00 2001 From: Albin Ekblom Date: Sat, 30 Jul 2016 20:51:09 +0200 Subject: [PATCH] Use configured shell to update plugins (#447) * Use configured shell to update plugins * Make it more compatible * Use shell-env@0.2.0 --- app/package.json | 2 +- app/plugins.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/package.json b/app/package.json index 4856bbe8..8f472837 100644 --- a/app/package.json +++ b/app/package.json @@ -18,7 +18,7 @@ "gaze": "1.1.0", "mkdirp": "0.5.1", "ms": "0.7.1", - "shell-env": "0.1.2", + "shell-env": "0.2.0", "uuid": "2.0.2" }, "eslintConfig": { diff --git a/app/plugins.js b/app/plugins.js index 6f600cc1..7cc2c538 100644 --- a/app/plugins.js +++ b/app/plugins.js @@ -197,15 +197,19 @@ function toDependencies (plugins) { } function install (fn) { - shellEnv().then((env) => { - let registry = exports.getDecoratedConfig().npmRegistry; - if (registry) env.NPM_CONFIG_REGISTRY = registry; + const { shell: cfgShell, npmRegistry } = exports.getDecoratedConfig(); + + const shell = cfgShell && cfgShell !== '' ? cfgShell : undefined; + + shellEnv(shell).then((env) => { + if (npmRegistry) env.NPM_CONFIG_REGISTRY = npmRegistry; env.npm_config_runtime = 'electron'; env.npm_config_target = '1.3.0'; env.npm_config_disturl = 'https://atom.io/download/atom-shell'; - exec('npm prune && npm install --production', { + exec('npm prune; npm install --production', { cwd: path, - env: env + env, + shell }, (err, stdout, stderr) => { if (err) return fn(err); fn(null);