fix: cross platform regex

pull/423/head
Webber 2022-08-03 01:53:15 +02:00
parent 202e87933b
commit 1f52cdf40b
3 changed files with 7 additions and 3 deletions

4
dist/index.js vendored
View File

@ -6159,11 +6159,13 @@ class Versioning {
} }
/** /**
* Whether the current tree has any version tags yet. * Whether the current tree has any version tags yet.
*
* Note: Currently this is run in all OSes, so the syntax must be cross-platform.
*/ */
static hasAnyVersionTags() { static hasAnyVersionTags() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const numberOfTagsAsString = yield system_1.default.run('sh', undefined, { 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`), input: Buffer.from(`git tag --list --merged HEAD | grep -E '^v?([0-9]+\\.)*[0-9]+.*' | wc -l`),
cwd: this.projectPath, cwd: this.projectPath,
silent: false, silent: false,
}); });

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -273,10 +273,12 @@ export default class Versioning {
/** /**
* Whether the current tree has any version tags yet. * Whether the current tree has any version tags yet.
*
* Note: Currently this is run in all OSes, so the syntax must be cross-platform.
*/ */
static async hasAnyVersionTags() { static async hasAnyVersionTags() {
const numberOfTagsAsString = await System.run('sh', undefined, { 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`), input: Buffer.from(`git tag --list --merged HEAD | grep -E '^v?([0-9]+\\.)*[0-9]+.*' | wc -l`),
cwd: this.projectPath, cwd: this.projectPath,
silent: false, silent: false,
}); });