Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.23.x] fix(windows): exit for failed sidecar download + add more echos #854

Draft
wants to merge 4 commits into
base: v0.23.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions scripts/windows/download-sidecar-executable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down