diff --git a/Gulpfile.js b/Gulpfile.js index f4d5b5237..5f9db0012 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -842,12 +842,14 @@ export async function downloadSidecar() { ["-ExecutionPolicy", "Bypass", "-File", "./scripts/windows/download-sidecar-executable.ps1"], { stdio: "inherit", shell: IS_WINDOWS }, ); + if (result.error) throw result.error; } else { // Use the make target to download the sidecar executable result = spawnSync("make", ["download-sidecar-executable"], { stdio: "inherit", shell: IS_WINDOWS, }); + if (result.error) throw result.error; } return result; diff --git a/scripts/windows/download-sidecar-executable.ps1 b/scripts/windows/download-sidecar-executable.ps1 index d2a12f44b..633de491f 100644 --- a/scripts/windows/download-sidecar-executable.ps1 +++ b/scripts/windows/download-sidecar-executable.ps1 @@ -19,9 +19,15 @@ if ($SKIP_DOWNLOAD_EXECUTABLE) { $EXECUTABLE_PATH = "ide-sidecar-$IDE_SIDECAR_VERSION_NO_V-runner-$SIDECAR_OS_ARCH.exe" # Download the executable using GitHub CLI (gh) + Write-Host "Downloading sidecar executable from Release $IDE_SIDECAR_VERSION" gh release download $IDE_SIDECAR_VERSION --repo $IDE_SIDECAR_REPO --pattern=$EXECUTABLE_PATH --output $EXECUTABLE_DOWNLOAD_PATH --clobber + if (-not (Test-Path $EXECUTABLE_DOWNLOAD_PATH -PathType Leaf)) { + Write-Host "Failed to download sidecar executable." + exit 1 + } # Set the executable permissions + Write-Host "Setting permissions for the downloaded sidecar executable" icacls $EXECUTABLE_DOWNLOAD_PATH /grant Everyone:"(X)" Write-Host "Downloaded sidecar executable to $EXECUTABLE_DOWNLOAD_PATH"