Skip to content

Commit

Permalink
fix: print error message when hub doesn't exist (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunjae Lee authored Aug 21, 2019
1 parent ebb3e78 commit 9ba45ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ github.com:

You can get an access token from [here](https://github.com/settings/tokens).

Or you can simply run `hub api` and it will generate the token and write the config file for you.
Or you can simply run `hub api`, follow the instruction and it will generate the token and write the config file for you.

### Dry Mode

Expand Down
7 changes: 5 additions & 2 deletions packages/shipjs/src/step/checkHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ export default () =>
title: 'Checking if `hub` exists.',
},
({ print, error, exitProcess }) => {
const exists = silentExec('hub --version').code === 0;
const exists =
silentExec('hub --version', { ignoreError: true }).code === 0;
if (!exists) {
print(error('You need to install `hub` first.'));
print(' > https://github.com/github/hub#installation');
print(
' > https://github.com/algolia/shipjs/blob/master/GUIDE.md#install-hub'
);
exitProcess(1);
}
}
Expand Down

0 comments on commit 9ba45ff

Please sign in to comment.