Skip to content

Commit

Permalink
chore: add script to bump the global Gateway version
Browse files Browse the repository at this point in the history
  • Loading branch information
CBenoit committed Oct 3, 2022
1 parent d7bfc60 commit 2e9fbc6
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tools/bump-version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/env pwsh

param(
[Parameter(Mandatory=$true)]
[string] $NewVersion
)

$ErrorActionPreference = "Stop"

Push-Location -Path $PSScriptRoot
Set-Location -Path ..

$targetFiles = @(
'./VERSION'
'./jetsocat/Cargo.toml'
'./devolutions-gateway/Cargo.toml'
'./powershell/DevolutionsGateway/DevolutionsGateway.psd1'
'./Cargo.lock'
'./fuzz/Cargo.lock'
)

try {
$currentVersion = Get-Content -Path './VERSION'
Write-Host "Current version is $currentVersion"
Write-Host "Next version is $NewVersion"
Write-Host

ForEach ($file in $targetFiles)
{
Write-Host "Updating $file"
((Get-Content -Path "$file" -Raw) -Replace "$currentVersion","$NewVersion") | Set-Content -Path "$file" -NoNewline
}
Write-Host

Write-Host 'Script executed successfully. Run `git status` to make sure everything looks good.'
}
catch {
Write-Host 'An error occurred:'
Write-Host $_.ScriptStackTrace
}
finally {
Pop-Location
}

0 comments on commit 2e9fbc6

Please sign in to comment.