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) {
|
||||
console.error(err.stack);
|
||||
notify(
|
||||
'Error updating plugins.',
|
||||
'Check `~/.hyperterm_plugins/npm-debug.log` for more information.'
|
||||
);
|
||||
if (/not a recognized/.test(err.message) || /command not found/.test(err.message)) {
|
||||
notify(
|
||||
'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 {
|
||||
// flag successful plugin update
|
||||
cache.set('plugins', id_);
|
||||
|
|
@ -186,7 +193,6 @@ function install (fn) {
|
|||
exec(prefix + 'npm prune && npm install --production', {
|
||||
cwd: path
|
||||
}, (err, stdout, stderr) => {
|
||||
if (err) alert(err.stack);
|
||||
if (err) return fn(err);
|
||||
fn(null);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue