15 lines
410 B
PowerShell
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()
|