28 lines
440 B
PowerShell
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"
|
|
}
|