@@ -35,17 +35,31 @@ case "$(uname -m)" in
3535esac
3636
3737# Determine download URL based on VERSION
38- if [ -n " $VERSION " ]; then
38+ if [ " ${VERSION} " = " latest" ] || [ -z " $VERSION " ]; then
39+ DOWNLOAD_URL=" https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM} -${ARCH} .tar.gz"
40+ CHECKSUMS_URL=" https://github.com/github/copilot-cli/releases/latest/download/SHA256SUMS.txt"
41+ elif [ " ${VERSION} " = " prerelease" ]; then
42+ # Get the latest prerelease tag
43+ if ! command -v git > /dev/null 2>&1 ; then
44+ echo " Error: git is required to install prerelease versions" >&2
45+ exit 1
46+ fi
47+ VERSION=" $( git ls-remote --tags https://github.com/github/copilot-cli | tail -1 | awk -F/ ' {print $NF}' ) "
48+ if [ -z " $VERSION " ]; then
49+ echo " Error: Could not determine prerelease version" >&2
50+ exit 1
51+ fi
52+ echo " Latest prerelease version: $VERSION "
53+ DOWNLOAD_URL=" https://github.com/github/copilot-cli/releases/download/${VERSION} /copilot-${PLATFORM} -${ARCH} .tar.gz"
54+ CHECKSUMS_URL=" https://github.com/github/copilot-cli/releases/download/${VERSION} /SHA256SUMS.txt"
55+ else
3956 # Prefix version with 'v' if not already present
4057 case " $VERSION " in
4158 v* ) ;;
4259 * ) VERSION=" v$VERSION " ;;
4360 esac
4461 DOWNLOAD_URL=" https://github.com/github/copilot-cli/releases/download/${VERSION} /copilot-${PLATFORM} -${ARCH} .tar.gz"
4562 CHECKSUMS_URL=" https://github.com/github/copilot-cli/releases/download/${VERSION} /SHA256SUMS.txt"
46- else
47- DOWNLOAD_URL=" https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM} -${ARCH} .tar.gz"
48- CHECKSUMS_URL=" https://github.com/github/copilot-cli/releases/latest/download/SHA256SUMS.txt"
4963fi
5064echo " Downloading from: $DOWNLOAD_URL "
5165
0 commit comments