Files
KlipperAnywhere/scripts/version.ps1
T
2026-05-14 02:27:26 +01:00

28 lines
440 B
PowerShell

param()
$ErrorActionPreference = "Stop"
try {
$version = git describe --tags --always --dirty 2>$null
if ($LASTEXITCODE -eq 0 -and $version) {
Write-Output $version
exit 0
}
} catch {
}
try {
$version = git rev-parse --short HEAD 2>$null
if ($LASTEXITCODE -eq 0 -and $version) {
Write-Output $version
exit 0
}
} catch {
}
if ($env:KA_VERSION) {
Write-Output $env:KA_VERSION
} else {
Write-Output "dev"
}