Skip to content

Commit 91b16b8

Browse files
authored
Merge pull request #19 from nicinabox/fix-getting-latest-tag
Sort tags by refname before grabbing the last one
2 parents 3c1fc78 + 7c3f5c3 commit 91b16b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function version(program, projectPath) {
249249

250250
if (!programOpts.skipTag) {
251251
log({text: 'Adjusting Git tag...'}, programOpts.quiet);
252-
child.execSync('git tag -f $(git tag | tail -1)', gitCmdOpts);
252+
child.execSync('git tag -f $(git tag --sort=v:refname | tail -1)', gitCmdOpts);
253253
}
254254
}
255255
}

test/helpers/getCurrTagHash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const execAsync = require('./execAsync');
66
* @return {string} Commit hash
77
*/
88
function getCurrTagHash(t) {
9-
return execAsync('git rev-list -n 1 $(git tag | tail -1)', {
9+
return execAsync('git rev-list -n 1 $(git tag --sort=v:refname | tail -1)', {
1010
cwd: t.context.tempDir
1111
});
1212
}

0 commit comments

Comments
 (0)