mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 18:13:38 +08:00
build: generate valid version when on release commit
This commit is contained in:
parent
7fe0fda808
commit
8ef7ba5a8d
@ -164,8 +164,10 @@ 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`)
|
||||
.slice(1);
|
||||
stableVersion = scmVersionTagRaw.replace(/-([0-9]+)-g/, '+$1.')
|
||||
+ (hasLocalChanges ? '.with-local-changes' : '');
|
||||
stableVersion = scmVersionTagRaw.replace(/-([0-9]+)-g/, '+$1.');
|
||||
if (hasLocalChanges) {
|
||||
stableVersion += stableVersion.includes('+') ? '.with-local-changes' : '+with-local-changes';
|
||||
}
|
||||
|
||||
experimentalVersion = `0.${stableVersion.replace(/^(\d+)\.(\d+)/, (_, major, minor) => {
|
||||
return '' + (parseInt(major, 10) * 100 + parseInt(minor, 10));
|
||||
|
Loading…
x
Reference in New Issue
Block a user