Skip to content
Merged
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
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -389,7 +389,7 @@ fetch_file() { # fetch_file <name> <dest>
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."
Expand Down
Loading