mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Merge pull request #206 from AikidoSec/fix-powershell-install-script
Fix scoping in powershell script
This commit is contained in:
commit
fa7be54ee9
1 changed files with 6 additions and 2 deletions
|
|
@ -110,9 +110,9 @@ function Remove-VoltaInstallation {
|
||||||
# Main installation
|
# Main installation
|
||||||
function Install-SafeChain {
|
function Install-SafeChain {
|
||||||
# Fetch latest version if VERSION is not set
|
# Fetch latest version if VERSION is not set
|
||||||
if ([string]::IsNullOrWhiteSpace($script:Version)) {
|
if ([string]::IsNullOrWhiteSpace($Version)) {
|
||||||
Write-Info "Fetching latest release version..."
|
Write-Info "Fetching latest release version..."
|
||||||
$script:Version = Get-LatestVersion
|
$Version = Get-LatestVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build installation message
|
# Build installation message
|
||||||
|
|
@ -166,6 +166,10 @@ function Install-SafeChain {
|
||||||
# Rename to final location
|
# Rename to final location
|
||||||
$finalFile = Join-Path $InstallDir "safe-chain.exe"
|
$finalFile = Join-Path $InstallDir "safe-chain.exe"
|
||||||
try {
|
try {
|
||||||
|
# Remove existing file if present (Move-Item -Force doesn't overwrite)
|
||||||
|
if (Test-Path $finalFile) {
|
||||||
|
Remove-Item -Path $finalFile -Force
|
||||||
|
}
|
||||||
Move-Item -Path $tempFile -Destination $finalFile -Force
|
Move-Item -Path $tempFile -Destination $finalFile -Force
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue