From bc44fc185251f91a5ff01557e732f98f0d324425 Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Wed, 21 Jan 2026 15:48:00 -0800 Subject: [PATCH] Allow installing prerelease CLI with `install.sh` --- install.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index ee8655ae..fb3d3d49 100755 --- a/install.sh +++ b/install.sh @@ -35,7 +35,24 @@ case "$(uname -m)" in esac # Determine download URL based on VERSION -if [ -n "$VERSION" ]; then +if [ "${VERSION}" = "latest" ] || [ -z "$VERSION" ]; then + DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM}-${ARCH}.tar.gz" + CHECKSUMS_URL="https://github.com/github/copilot-cli/releases/latest/download/SHA256SUMS.txt" +elif [ "${VERSION}" = "prerelease" ]; then + # Get the latest prerelease tag + if ! command -v git >/dev/null 2>&1; then + echo "Error: git is required to install prerelease versions" >&2 + exit 1 + fi + VERSION="$(git ls-remote --tags https://github.com/github/copilot-cli | tail -1 | awk -F/ '{print $NF}')" + if [ -z "$VERSION" ]; then + echo "Error: Could not determine prerelease version" >&2 + exit 1 + fi + echo "Latest prerelease version: $VERSION" + DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/download/${VERSION}/copilot-${PLATFORM}-${ARCH}.tar.gz" + CHECKSUMS_URL="https://github.com/github/copilot-cli/releases/download/${VERSION}/SHA256SUMS.txt" +else # Prefix version with 'v' if not already present case "$VERSION" in v*) ;; @@ -43,9 +60,6 @@ if [ -n "$VERSION" ]; then esac DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/download/${VERSION}/copilot-${PLATFORM}-${ARCH}.tar.gz" CHECKSUMS_URL="https://github.com/github/copilot-cli/releases/download/${VERSION}/SHA256SUMS.txt" -else - DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM}-${ARCH}.tar.gz" - CHECKSUMS_URL="https://github.com/github/copilot-cli/releases/latest/download/SHA256SUMS.txt" fi echo "Downloading from: $DOWNLOAD_URL"