diff --git a/scripts/install-core.sh b/scripts/install-core.sh index 1d38714..8c1f23f 100755 --- a/scripts/install-core.sh +++ b/scripts/install-core.sh @@ -99,11 +99,12 @@ check_not_symlink() { # Try to download pre-built binary with integrity verification download_binary() { - local os=$(detect_os) - local arch=$(detect_arch) - local binary_name="core-${os}-${arch}" - local binary_url="https://github.com/$REPO/releases/download/$VERSION/${binary_name}" - local checksum_url="https://github.com/$REPO/releases/download/$VERSION/checksums.txt" + local os arch binary_name binary_url checksum_url + os=$(detect_os) + arch=$(detect_arch) + binary_name="core-${os}-${arch}" + binary_url="https://github.com/$REPO/releases/download/$VERSION/${binary_name}" + checksum_url="https://github.com/$REPO/releases/download/$VERSION/checksums.txt" if [[ "$os" == "windows" ]]; then binary_name="${binary_name}.exe" diff --git a/scripts/install-deps.ps1 b/scripts/install-deps.ps1 index e9c70b3..e3573c6 100644 --- a/scripts/install-deps.ps1 +++ b/scripts/install-deps.ps1 @@ -40,6 +40,9 @@ function Install-Chocolatey { Write-Info "Executing Chocolatey installer..." & $tempScript + if ($LASTEXITCODE -ne 0) { + Write-Err "Chocolatey installation failed with exit code $LASTEXITCODE" + } } finally { # Clean up temp file if (Test-Path $tempScript) { diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index 387aa36..39c2412 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -88,7 +88,10 @@ install_brew() { error "Failed to download Homebrew installer" } - /bin/bash "$temp_script" + /bin/bash "$temp_script" || { + rm -f "$temp_script" + error "Homebrew installation failed" + } rm -f "$temp_script" # Add to PATH for this session @@ -232,7 +235,10 @@ setup_linux_apt() { error "Failed to download NodeSource setup script" } - sudo -E bash "$temp_script" + sudo -E bash "$temp_script" || { + rm -f "$temp_script" + error "NodeSource setup failed" + } rm -f "$temp_script" sudo apt-get install -y nodejs fi