Server changes/Sonarr
This commit is contained in:
+4
-3
@@ -52,12 +52,13 @@ if ($Version) {
|
||||
# Same scheme as app/build.gradle.kts: major*10000 + minor*100 + patch.
|
||||
$code = [int]$parts[0] * 10000 + [int]$parts[1] * 100 + [int]$parts[2]
|
||||
|
||||
$gradle = $gradle -replace 'versionCode = \d+', "versionCode = $code"
|
||||
$gradle = $gradle -replace 'versionName = "[^"]*"', "versionName = `"$Version`""
|
||||
$gradle = $gradle -replace 'val defaultVersionName = "[^"]*"', "val defaultVersionName = `"$Version`""
|
||||
Set-Content -LiteralPath $gradleFile -Value $gradle -NoNewline
|
||||
Write-Host "Set version $Version (versionCode $code)" -ForegroundColor Cyan
|
||||
} else {
|
||||
if ($gradle -notmatch 'versionName = "([^"]*)"') { throw 'Could not read versionName from app/build.gradle.kts' }
|
||||
if ($gradle -notmatch 'val defaultVersionName = "([^"]*)"') {
|
||||
throw 'Could not read defaultVersionName from app/build.gradle.kts'
|
||||
}
|
||||
$Version = $Matches[1]
|
||||
Write-Host "Building existing version $Version" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user