Skip to content

Commit dc98c1b

Browse files
authored
Merge pull request #773 from github/devm33/install-pinned
Allow specifying a version for the install script
2 parents 29bedd3 + c8b4af0 commit dc98c1b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ Use `| sudo bash` to run as root and install to `/usr/local/bin`.
7474
Set `PREFIX` to install to `$PREFIX/bin/` directory. Defaults to `/usr/local`
7575
when run as root or `$HOME/.local` when run as a non-root user.
7676

77+
Set `VERSION` to install a specific version. Defaults to the latest version.
78+
7779
### Launching the CLI
7880

7981
```bash

install.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ case "$(uname -m)" in
3434
*) echo "Error: Unsupported architecture $(uname -m)" >&2 ; exit 1 ;;
3535
esac
3636

37-
DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM}-${ARCH}.tar.gz"
37+
# Determine download URL based on VERSION
38+
if [ -n "$VERSION" ]; then
39+
# Prefix version with 'v' if not already present
40+
case "$VERSION" in
41+
v*) ;;
42+
*) VERSION="v$VERSION" ;;
43+
esac
44+
DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/download/${VERSION}/copilot-${PLATFORM}-${ARCH}.tar.gz"
45+
else
46+
DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM}-${ARCH}.tar.gz"
47+
fi
3848
echo "Downloading from: $DOWNLOAD_URL"
3949

4050
# Download and extract with error handling

0 commit comments

Comments
 (0)