Files
ssh-manager/scripts/release/get-app-version.ps1
2026-04-16 23:28:26 +08:00

15 lines
410 B
PowerShell

param(
[string]$PomPath = (Join-Path $PSScriptRoot '..\..\backend\pom.xml')
)
$resolvedPath = Resolve-Path -LiteralPath $PomPath -ErrorAction Stop
[xml]$pom = Get-Content -LiteralPath $resolvedPath -Raw -Encoding UTF8
$version = $pom.project.version
if ([string]::IsNullOrWhiteSpace($version)) {
Write-Error "Failed to read <project><version> from $resolvedPath"
exit 1
}
Write-Output $version.Trim()