Skip to content

Commit

Permalink
fix(doctor): improve error handling in system stack checks
Browse files Browse the repository at this point in the history
closes #260
- handle execa errors specifically in the checks for nginx and systemd
  • Loading branch information
acburdine committed Jul 4, 2017
1 parent 19d79e7 commit 3f508a0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/commands/doctor/checks/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ module.exports = [{

return context.ui.listr([{
title: 'Systemd',
task: (ctx) => execa.shell('dpkg -l | grep systemd').then(() => {
ctx.systemd = true;
})
task: () => execa.shell('dpkg -l | grep systemd')
.catch(() => Promise.reject(new errors.SystemError('systemd is not installed')))
}, {
title: 'Nginx',
task: (ctx) => execa.shell('dpkg -l | grep nginx').then(() => {
ctx.nginx = true;
})
task: () => execa.shell('dpkg -l | grep nginx')
.catch(() => Promise.reject(new errors.SystemError('nginx is not installed')))
}], context, {concurrent: true, renderer: context.ui.verbose ? 'verbose' : 'silent', exitOnError: false})
});
}
Expand Down

0 comments on commit 3f508a0

Please sign in to comment.