Skip to content

Commit a6c9914

Browse files
committed
Stop blaming repository permissions for a download failure
The gh fallback is now a last resort for an outage, not a private-repo workaround, so the error told people to authenticate when their connection was the problem.
1 parent e7651b8 commit a6c9914

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎install.ps1‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ Ok "config written to $envPath"
262262

263263
# When piped through `iex` there is no local checkout, so companion files are
264264
# fetched over HTTP. `gh` covers the window where the repository is still
265-
# private and raw.githubusercontent.com 404s.
265+
# unreachable; `gh` is a last resort.
266266
$SrcDir = $null
267267
if ($PSScriptRoot -and (Test-Path (Join-Path $PSScriptRoot 'qbraid-code.cmd'))) {
268268
$SrcDir = $PSScriptRoot
@@ -295,7 +295,7 @@ function Fetch-File {
295295
}
296296

297297
if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
298-
Die "could not download $Name. While this repository is private you need the GitHub CLI: https://cli.github.com"
298+
Die "could not download $Name from qbraid.com or GitHub. Check your connection and re-run."
299299
}
300300
$text = (gh api -H 'Accept: application/vnd.github.raw' "$GhContents/$Name" | Out-String)
301301
if ($LASTEXITCODE -ne 0 -or -not $text) {

‎install.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ ok "config written to $HOME_DIR/env"
374374

375375
# When piped from curl there is no local checkout, so companion files are
376376
# fetched: qbraid.com first (allowlisted on networks that block GitHub), then
377-
# raw.githubusercontent, then `gh` for the window where the repo is private.
377+
# raw.githubusercontent, then `gh` as a last resort if both are unreachable.
378378
SRC_DIR=""
379379
if [ -f "${BASH_SOURCE[0]:-}" ]; then
380380
CAND=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
@@ -389,7 +389,7 @@ fetch_file() { # fetch_file <name> <dest>
389389
if curl -fsSL -m 30 -o "$dest" "$SITE_BASE/$name" 2>/dev/null && [ -s "$dest" ]; then return 0; fi
390390
if curl -fsSL -m 30 -o "$dest" "$RAW_BASE/$name" 2>/dev/null && [ -s "$dest" ]; then return 0; fi
391391
command -v gh >/dev/null 2>&1 \
392-
|| die "could not download $name. While this repository is private you need the GitHub CLI: https://cli.github.com"
392+
|| die "could not download $name from qbraid.com or GitHub. Check your connection and re-run."
393393
gh api -H "Accept: application/vnd.github.raw" "$GH_CONTENTS/$name" > "$dest" \
394394
|| die "could not download $name — is \`gh auth login\` done, and are you in the qBraid org?"
395395
[ -s "$dest" ] || die "downloaded $name but it is empty."

0 commit comments

Comments
 (0)