mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
plugins: more graceful npm error
This commit is contained in:
parent
b147e235d9
commit
f640c72de6
1 changed files with 11 additions and 5 deletions
16
plugins.js
16
plugins.js
|
|
@ -58,10 +58,17 @@ function updatePlugins ({ force = false } = {}) {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err.stack);
|
console.error(err.stack);
|
||||||
notify(
|
if (/not a recognized/.test(err.message) || /command not found/.test(err.message)) {
|
||||||
'Error updating plugins.',
|
notify(
|
||||||
'Check `~/.hyperterm_plugins/npm-debug.log` for more information.'
|
'Error updating plugins.',
|
||||||
);
|
'We could not find the `npm` command. Make sure it\'s in $PATH'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
notify(
|
||||||
|
'Error updating plugins.',
|
||||||
|
'Check `~/.hyperterm_plugins/npm-debug.log` for more information.'
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// flag successful plugin update
|
// flag successful plugin update
|
||||||
cache.set('plugins', id_);
|
cache.set('plugins', id_);
|
||||||
|
|
@ -186,7 +193,6 @@ function install (fn) {
|
||||||
exec(prefix + 'npm prune && npm install --production', {
|
exec(prefix + 'npm prune && npm install --production', {
|
||||||
cwd: path
|
cwd: path
|
||||||
}, (err, stdout, stderr) => {
|
}, (err, stdout, stderr) => {
|
||||||
if (err) alert(err.stack);
|
|
||||||
if (err) return fn(err);
|
if (err) return fn(err);
|
||||||
fn(null);
|
fn(null);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue