mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix scoping in powershell script
This commit is contained in:
parent
9518be35b4
commit
bdddf8f37e
1 changed files with 6 additions and 2 deletions
|
|
@ -110,9 +110,9 @@ function Remove-VoltaInstallation {
|
|||
# Main installation
|
||||
function Install-SafeChain {
|
||||
# Fetch latest version if VERSION is not set
|
||||
if ([string]::IsNullOrWhiteSpace($script:Version)) {
|
||||
if ([string]::IsNullOrWhiteSpace($Version)) {
|
||||
Write-Info "Fetching latest release version..."
|
||||
$script:Version = Get-LatestVersion
|
||||
$Version = Get-LatestVersion
|
||||
}
|
||||
|
||||
# Build installation message
|
||||
|
|
@ -166,6 +166,10 @@ function Install-SafeChain {
|
|||
# Rename to final location
|
||||
$finalFile = Join-Path $InstallDir "safe-chain.exe"
|
||||
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
|
||||
}
|
||||
catch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue