File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
267267if ($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 ) {
Original file line number Diff line number Diff 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 .
378378SRC_DIR=" "
379379if [ -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."
You can’t perform that action at this time.
0 commit comments