Sync eng/common directory with azure-sdk-tools repository (#48)
This commit is contained in:
Родитель
5cd2f2778e
Коммит
55fdc3572a
|
@ -2,7 +2,7 @@
|
|||
# Expects the buildtools to be cloned
|
||||
|
||||
parameters:
|
||||
BaseBranchName: master
|
||||
BaseBranchName: $(Build.SourceBranch)
|
||||
PRBranchName: not-specified
|
||||
PROwner: azure-sdk
|
||||
CommitMsg: not-specified
|
||||
|
|
|
@ -11,12 +11,12 @@ param (
|
|||
$Language = $Language.ToLower()
|
||||
|
||||
# Regex inspired but simplified from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
||||
$SEMVER_REGEX = "^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-?(?<prelabel>[a-zA-Z-]*)(?:\.?(?<prenumber>0|[1-9]\d*)))?$"
|
||||
$SEMVER_REGEX = "^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-?(?<prelabel>[a-zA-Z-]*)(?:\.?(?<prenumber>0|[1-9]\d*))?)?$"
|
||||
|
||||
function ToSemVer($version){
|
||||
if ($version -match $SEMVER_REGEX)
|
||||
{
|
||||
if($matches['prelabel'] -eq $null) {
|
||||
if(-not $matches['prelabel']) {
|
||||
# artifically provide these values for non-prereleases to enable easy sorting of them later than prereleases.
|
||||
$prelabel = "zzz"
|
||||
$prenumber = 999;
|
||||
|
@ -24,7 +24,13 @@ function ToSemVer($version){
|
|||
}
|
||||
else {
|
||||
$prelabel = $matches["prelabel"]
|
||||
$prenumber = [int]$matches["prenumber"]
|
||||
$prenumber = 0
|
||||
|
||||
# some older packages don't have a prenumber, should handle this
|
||||
if($matches["prenumber"]){
|
||||
$prenumber = [int]$matches["prenumber"]
|
||||
}
|
||||
|
||||
$isPre = $true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче