Skip to content

Commit

Permalink
[fixed] checking that a local repo is behind the remote
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKVal committed Nov 19, 2015
1 parent 11cfe43 commit 8a5c227
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ function release({ type, preid, npmTagName }) {
console.info('No pending changes'.cyan);

// ensure git repo last version is fetched
if (/\[behind (.*)\]/.test(exec('git fetch').output)) {
exec('git fetch');
if (/behind (.*)\]/.test(exec('git status -sb').output)) {
printErrorAndExit(`Your repo is behind by ${RegExp.$1} commits`);
}
console.info('Current with latest changes from remote'.cyan);
Expand Down

0 comments on commit 8a5c227

Please sign in to comment.