Files
Magent/scripts/env_build_number.ps1
Assclaw a3b5759708
Magent CI/CD / verify (push) Successful in 10m31s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Skipped
Enforce recipient-bound single-use invites and fix issue card layout; clean release tooling
2026-09-07 19:59:51 +12:00

11 lines
491 B
PowerShell

function Set-EnvBuildNumber {
param(
[AllowEmptyString()][string]$Content,
[Parameter(Mandatory = $true)][string]$BuildNumber
)
if ($BuildNumber -notmatch '^\d+$') { throw 'Build number must contain digits only.' }
$newline = if ($Content.Contains("`r`n")) { "`r`n" } else { "`n" }
$remaining = [regex]::Replace($Content, '(?m)^[\t ]*(?:export[\t ]+)?BUILD_NUMBER[\t ]*=[^\r\n]*(?:\r?\n|$)', '')
return "BUILD_NUMBER=$BuildNumber$newline$remaining"
}