plugins: more graceful npm error

This commit is contained in:
Guillermo Rauch 2016-07-14 09:25:49 -07:00
parent b147e235d9
commit f640c72de6

View file

@ -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);
}); });