diff --git a/README.md b/README.md index 405f6cb..5dd8dd1 100644 --- a/README.md +++ b/README.md @@ -32,21 +32,6 @@ That is all. The installer: Re-running it is safe. -> **While this repository is private**, neither `qbraid.com/code.sh` nor -> `qbraid.com/code.ps1` is live yet. Use the GitHub CLI instead (`gh auth login` -> first, and you must be in the `qBraid` org): -> -> ```bash -> # macOS and Linux -> gh api -H "Accept: application/vnd.github.raw" \ -> /repos/qBraid/qbraid-code/contents/install.sh | bash -> ``` -> -> ```powershell -> # Windows -> gh api -H "Accept: application/vnd.github.raw" /repos/qBraid/qbraid-code/contents/install.ps1 | Out-String | iex -> ``` - ## Use ```bash diff --git a/install.ps1 b/install.ps1 index 7cc33d1..e8d89d8 100644 --- a/install.ps1 +++ b/install.ps1 @@ -262,7 +262,7 @@ Ok "config written to $envPath" # When piped through `iex` there is no local checkout, so companion files are # fetched over HTTP. `gh` covers the window where the repository is still -# private and raw.githubusercontent.com 404s. +# unreachable; `gh` is a last resort. $SrcDir = $null if ($PSScriptRoot -and (Test-Path (Join-Path $PSScriptRoot 'qbraid-code.cmd'))) { $SrcDir = $PSScriptRoot @@ -295,7 +295,7 @@ function Fetch-File { } if (-not (Get-Command gh -ErrorAction SilentlyContinue)) { - Die "could not download $Name. While this repository is private you need the GitHub CLI: https://cli.github.com" + Die "could not download $Name from qbraid.com or GitHub. Check your connection and re-run." } $text = (gh api -H 'Accept: application/vnd.github.raw' "$GhContents/$Name" | Out-String) if ($LASTEXITCODE -ne 0 -or -not $text) { diff --git a/install.sh b/install.sh index 482f450..53f5a72 100755 --- a/install.sh +++ b/install.sh @@ -374,7 +374,7 @@ ok "config written to $HOME_DIR/env" # When piped from curl there is no local checkout, so companion files are # fetched: qbraid.com first (allowlisted on networks that block GitHub), then -# raw.githubusercontent, then `gh` for the window where the repo is private. +# raw.githubusercontent, then `gh` as a last resort if both are unreachable. SRC_DIR="" if [ -f "${BASH_SOURCE[0]:-}" ]; then CAND=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) @@ -389,7 +389,7 @@ fetch_file() { # fetch_file if curl -fsSL -m 30 -o "$dest" "$SITE_BASE/$name" 2>/dev/null && [ -s "$dest" ]; then return 0; fi if curl -fsSL -m 30 -o "$dest" "$RAW_BASE/$name" 2>/dev/null && [ -s "$dest" ]; then return 0; fi command -v gh >/dev/null 2>&1 \ - || die "could not download $name. While this repository is private you need the GitHub CLI: https://cli.github.com" + || die "could not download $name from qbraid.com or GitHub. Check your connection and re-run." gh api -H "Accept: application/vnd.github.raw" "$GH_CONTENTS/$name" > "$dest" \ || die "could not download $name — is \`gh auth login\` done, and are you in the qBraid org?" [ -s "$dest" ] || die "downloaded $name but it is empty."