build: version from git tag which consists two or more digits

Currently, we can't publish v10 because the `--match` pattern in describe can't match the tag `v10.0.0`. The new glob has the following semantics:

```
v[0-9]*.[0-9]*.[0-9]*
```

Couldn't make it stricter because didn't find an easy way to enable extglobs for git for everyone.
This commit is contained in:
mgechev 2020-04-08 12:35:51 -07:00 committed by Minko Gechev
parent d3f12e1c74
commit 0181d8538f

View File

@ -164,7 +164,7 @@ function _getVersionFromGit(experimental: boolean): string {
}
const hasLocalChanges = _exec(`git status --porcelain`) != '';
const scmVersionTagRaw = _exec(`git describe --match v[0-9].[0-9].[0-9]* --abbrev=7 --tags`)
const scmVersionTagRaw = _exec(`git describe --match v[0-9]*.[0-9]*.[0-9]* --abbrev=7 --tags`)
.slice(1);
stableVersion = scmVersionTagRaw.replace(/-([0-9]+)-g/, '+$1.');
if (hasLocalChanges) {