detached 1e443d6

feat(install): add support for pre-release and custom version installation

Add GORDON_PRERELEASE flag to install latest pre-release:
  curl -fsSL https://gordon.bnema.dev/install | GORDON_PRERELEASE=1 bash

Add GORDON_VERSION flag for specific version:
  curl -fsSL https://gordon.bnema.dev/install | GORDON_VERSION=v1.2.3 bash

Installer now queries GitHub API to find the latest release (including pre-releases) when flags are set, providing more flexibility for testing development builds.
commit
1e443d64ebd3ebdea50253a0256cdffae0f333c5
author
bnema · · 2026-01-31 22:22 UTC
parent
378df3f
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +27 -2
M install.sh +27 -2
@@ -3,9 +3,11 @@ set -e
33
44 # Gordon installer script
55 # Usage: curl -fsSL https://gordon.bnema.dev/install | bash
6+# Usage with pre-release: curl -fsSL https://gordon.bnema.dev/install | GORDON_PRERELEASE=1 bash
67
78 REPO="bnema/gordon"
89 INSTALL_DIR="/usr/local/bin"
10+VERSION="${GORDON_VERSION:-latest}"
911
1012 echo "Installing Gordon..."
1113
@@ -43,14 +45,37 @@ echo "Detected: ${OS}/${ARCH}"
4345
4446 # Construct download URL
4547 TARBALL="gordon_${OS}_${ARCH}.tar.gz"
46-DOWNLOAD_URL="https://github.com/${REPO}/releases/latest/download/${TARBALL}"
48+
49+# Determine version to download
50+if [ "$VERSION" = "latest" ] && [ -n "$GORDON_PRERELEASE" ]; then
51+ echo "Finding latest pre-release..."
52+ # Get latest release (including pre-releases) from GitHub API
53+ RELEASE_DATA=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases?per_page=1" 2>/dev/null || echo "")
54+ if [ -z "$RELEASE_DATA" ]; then
55+ echo "Error: Failed to fetch release information from GitHub API"
56+ exit 1
57+ fi
58+ VERSION=$(echo "$RELEASE_DATA" | grep -m1 '"tag_name"' | sed -E 's/.*"tag_name":\s*"([^"]+)".*/\1/')
59+ if [ -z "$VERSION" ]; then
60+ echo "Error: Could not determine latest pre-release version"
61+ exit 1
62+ fi
63+ echo "Using pre-release version: ${VERSION}"
64+elif [ "$VERSION" = "latest" ]; then
65+ VERSION="latest"
66+ echo "Using latest stable release"
67+else
68+ echo "Using version: ${VERSION}"
69+fi
70+
71+DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${VERSION}/${TARBALL}"
4772
4873 # Create temporary directory
4974 TMP_DIR=$(mktemp -d)
5075 trap 'rm -rf "$TMP_DIR"' EXIT
5176
5277 # Download checksums file
53-CHECKSUMS_URL="https://github.com/${REPO}/releases/latest/download/checksums.txt"
78+CHECKSUMS_URL="https://github.com/${REPO}/releases/download/${VERSION}/checksums.txt"
5479 echo "Downloading checksums..."
5580 if ! curl -fsSL "$CHECKSUMS_URL" -o "$TMP_DIR/checksums.txt"; then
5681 echo "Error: Failed to download checksums file"
@@ -3,9 +3,11 @@ set -e
3 3
4 # Gordon installer script4 # Gordon installer script
5 # Usage: curl -fsSL https://gordon.bnema.dev/install | bash5 # Usage: curl -fsSL https://gordon.bnema.dev/install | bash
6+# Usage with pre-release: curl -fsSL https://gordon.bnema.dev/install | GORDON_PRERELEASE=1 bash
6 7
7 REPO="bnema/gordon"8 REPO="bnema/gordon"
8 INSTALL_DIR="/usr/local/bin"9 INSTALL_DIR="/usr/local/bin"
10+VERSION="${GORDON_VERSION:-latest}"
9 11
10 echo "Installing Gordon..."12 echo "Installing Gordon..."
11 13
@@ -43,14 +45,37 @@ echo "Detected: ${OS}/${ARCH}"
43 45
44 # Construct download URL46 # Construct download URL
45 TARBALL="gordon_${OS}_${ARCH}.tar.gz"47 TARBALL="gordon_${OS}_${ARCH}.tar.gz"
46-DOWNLOAD_URL="https://github.com/${REPO}/releases/latest/download/${TARBALL}"48+
49+# Determine version to download
50+if [ "$VERSION" = "latest" ] && [ -n "$GORDON_PRERELEASE" ]; then
51+ echo "Finding latest pre-release..."
52+ # Get latest release (including pre-releases) from GitHub API
53+ RELEASE_DATA=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases?per_page=1" 2>/dev/null || echo "")
54+ if [ -z "$RELEASE_DATA" ]; then
55+ echo "Error: Failed to fetch release information from GitHub API"
56+ exit 1
57+ fi
58+ VERSION=$(echo "$RELEASE_DATA" | grep -m1 '"tag_name"' | sed -E 's/.*"tag_name":\s*"([^"]+)".*/\1/')
59+ if [ -z "$VERSION" ]; then
60+ echo "Error: Could not determine latest pre-release version"
61+ exit 1
62+ fi
63+ echo "Using pre-release version: ${VERSION}"
64+elif [ "$VERSION" = "latest" ]; then
65+ VERSION="latest"
66+ echo "Using latest stable release"
67+else
68+ echo "Using version: ${VERSION}"
69+fi
70+
71+DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${VERSION}/${TARBALL}"
47 72
48 # Create temporary directory73 # Create temporary directory
49 TMP_DIR=$(mktemp -d)74 TMP_DIR=$(mktemp -d)
50 trap 'rm -rf "$TMP_DIR"' EXIT75 trap 'rm -rf "$TMP_DIR"' EXIT
51 76
52 # Download checksums file77 # Download checksums file
53-CHECKSUMS_URL="https://github.com/${REPO}/releases/latest/download/checksums.txt"78+CHECKSUMS_URL="https://github.com/${REPO}/releases/download/${VERSION}/checksums.txt"
54 echo "Downloading checksums..."79 echo "Downloading checksums..."
55 if ! curl -fsSL "$CHECKSUMS_URL" -o "$TMP_DIR/checksums.txt"; then80 if ! curl -fsSL "$CHECKSUMS_URL" -o "$TMP_DIR/checksums.txt"; then
56 echo "Error: Failed to download checksums file"81 echo "Error: Failed to download checksums file"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close