Files
velopack/set-nbgv-version.ps1
2024-10-07 21:31:56 -06:00

19 lines
483 B
PowerShell

param(
[string]$version = $(nbgv get-version -v NuGetPackageVersion).Trim()
)
$scriptDir = $PSScriptRoot
$path = Join-Path $scriptDir "Cargo.toml"
Write-Host "Setting version to $version"
(Get-Content $path) | ForEach-Object {
if ($_ -match '^version\s*=\s*".*"') {
$_ -replace '^version\s*=\s*".*"', "version = `"$version`""
}
else {
$_
}
} | Set-Content $path
Set-Location "$scriptDir/src/lib-nodejs"
npm version $version --no-git-tag-version