mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-22 18:49:44 +00:00
f24eb02ca1
* Pipeline to check that version is updated
22 lines
553 B
PowerShell
22 lines
553 B
PowerShell
Param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$currentVersion,
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$lastVersion
|
|
)
|
|
|
|
if ($currentVersion.StartsWith("v")){
|
|
$currentVersion = $currentVersion.Substring(1)
|
|
}
|
|
|
|
if ($lastVersion.StartsWith("v")){
|
|
$lastVersion = $lastVersion.Substring(1)
|
|
}
|
|
|
|
$isNewer = $currentVersion.CompareTo($lastVersion) -eq 1
|
|
if ($isNewer -eq $false){
|
|
throw "Version is not incremented. Current version " + $currentVersion + ". Last version " + $lastVersion
|
|
}
|
|
else{
|
|
Write-Host "Version has been incremented"
|
|
} |