Skip to content

Commit

Permalink
Fixes #193 - use git describe istead of listing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiekbielicki authored Jul 11, 2024
1 parent f06098a commit 9af266a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions git-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module.exports = {
* Returns latest tag, sorted by version or null if no tag was found
*/
getLatestTag: (prefix) => {
const maybeGrepCommand = prefix !== '' ? `| grep "^${prefix}"` : '';
const stdout = exec(`git tag -l ${maybeGrepCommand} | sort -V | tail -n 1`);
const stdout = exec(`git describe --match="${prefix}*"`);
const lastTag = String(stdout).trim();
return lastTag === '' ? null : lastTag;
}
Expand Down

0 comments on commit 9af266a

Please sign in to comment.