mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Use configured shell to update plugins (#447)
* Use configured shell to update plugins * Make it more compatible * Use shell-env@0.2.0
This commit is contained in:
parent
e295e6f66e
commit
3198a90823
2 changed files with 10 additions and 6 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
"gaze": "1.1.0",
|
"gaze": "1.1.0",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"ms": "0.7.1",
|
"ms": "0.7.1",
|
||||||
"shell-env": "0.1.2",
|
"shell-env": "0.2.0",
|
||||||
"uuid": "2.0.2"
|
"uuid": "2.0.2"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|
|
||||||
|
|
@ -197,15 +197,19 @@ function toDependencies (plugins) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install (fn) {
|
function install (fn) {
|
||||||
shellEnv().then((env) => {
|
const { shell: cfgShell, npmRegistry } = exports.getDecoratedConfig();
|
||||||
let registry = exports.getDecoratedConfig().npmRegistry;
|
|
||||||
if (registry) env.NPM_CONFIG_REGISTRY = registry;
|
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_runtime = 'electron';
|
||||||
env.npm_config_target = '1.3.0';
|
env.npm_config_target = '1.3.0';
|
||||||
env.npm_config_disturl = 'https://atom.io/download/atom-shell';
|
env.npm_config_disturl = 'https://atom.io/download/atom-shell';
|
||||||
exec('npm prune && npm install --production', {
|
exec('npm prune; npm install --production', {
|
||||||
cwd: path,
|
cwd: path,
|
||||||
env: env
|
env,
|
||||||
|
shell
|
||||||
}, (err, stdout, stderr) => {
|
}, (err, stdout, stderr) => {
|
||||||
if (err) return fn(err);
|
if (err) return fn(err);
|
||||||
fn(null);
|
fn(null);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue