fix: make v character in version tags optional

pull/423/head
Webber 2022-08-03 01:30:53 +02:00
parent c068855899
commit 202e87933b
3 changed files with 11 additions and 11 deletions

10
dist/index.js vendored
View File

@ -6158,17 +6158,17 @@ class Versioning {
});
}
/**
* Whether or not the repository has any version tags yet.
* Whether the current tree has any version tags yet.
*/
static hasAnyVersionTags() {
return __awaiter(this, void 0, void 0, function* () {
const numberOfCommitsAsString = yield system_1.default.run('sh', undefined, {
input: Buffer.from('git tag --list --merged HEAD | grep v[0-9]* | wc -l'),
const numberOfTagsAsString = yield system_1.default.run('sh', undefined, {
input: Buffer.from(`git tag --list --merged HEAD | grep -E ^v?(\\d+\\.){0,2}\\d+[\\w\\-.+]* | wc -l`),
cwd: this.projectPath,
silent: false,
});
const numberOfCommits = Number.parseInt(numberOfCommitsAsString, 10);
return numberOfCommits !== 0;
const numberOfTags = Number.parseInt(numberOfTagsAsString, 10);
return numberOfTags !== 0;
});
}
/**

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -272,18 +272,18 @@ export default class Versioning {
}
/**
* Whether or not the repository has any version tags yet.
* Whether the current tree has any version tags yet.
*/
static async hasAnyVersionTags() {
const numberOfCommitsAsString = await System.run('sh', undefined, {
input: Buffer.from('git tag --list --merged HEAD | grep v[0-9]* | wc -l'),
const numberOfTagsAsString = await System.run('sh', undefined, {
input: Buffer.from(`git tag --list --merged HEAD | grep -E ^v?(\\d+\\.){0,2}\\d+[\\w\\-.+]* | wc -l`),
cwd: this.projectPath,
silent: false,
});
const numberOfCommits = Number.parseInt(numberOfCommitsAsString, 10);
const numberOfTags = Number.parseInt(numberOfTagsAsString, 10);
return numberOfCommits !== 0;
return numberOfTags !== 0;
}
/**