Simplify nbgv version setting

This commit is contained in:
Caelan
2024-10-02 16:06:09 -06:00
parent 5b3dba1c1d
commit 1a61ef588e
2 changed files with 31 additions and 16 deletions

19
set-nbgv-version.ps1 Normal file
View File

@@ -0,0 +1,19 @@
$scriptDir = $PSScriptRoot
$path = Join-Path $scriptDir "Cargo.toml"
$version = (nbgv get-version -v NuGetPackageVersion).Trim()
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
cargo update --offline
cargo pkgid -p velopack
Set-Location "$scriptDir/src/lib-nodejs"
npm version $version --no-git-tag-version