2727DOWNLOAD_URL=" https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM} -${ARCH} .tar.gz"
2828echo " Downloading from: $DOWNLOAD_URL "
2929
30- DOWNLOAD_DIR=" ${HOME} /.copilot"
31- mkdir -p " $DOWNLOAD_DIR "
32-
3330# Download and extract with error handling
3431TMP_TARBALL=" $( mktemp) "
3532if command -v curl > /dev/null 2>&1 ; then
@@ -48,8 +45,6 @@ if ! tar -tzf "$TMP_TARBALL" >/dev/null 2>&1; then
4845 exit 1
4946fi
5047
51- tar -xz -C " $DOWNLOAD_DIR " -f " $TMP_TARBALL "
52- rm -f " $TMP_TARBALL "
5348if [ " $( id -u 2> /dev/null || echo 1) " -eq 0 ]; then
5449 PREFIX=" ${PREFIX:-/ usr/ local} "
5550else
@@ -63,17 +58,13 @@ if ! mkdir -p "$INSTALL_DIR"; then
6358fi
6459
6560# Install binary
66- if [ -f " $DOWNLOAD_DIR /copilot" ]; then
67- if [ -f " $INSTALL_DIR /copilot" ]; then
68- echo " Notice: Replacing copilot binary found at $INSTALL_DIR /copilot."
69- fi
70- mv -f " $DOWNLOAD_DIR /copilot" " $INSTALL_DIR /copilot"
71- chmod +x " $INSTALL_DIR /copilot"
72- echo " ✓ GitHub Copilot CLI installed to $INSTALL_DIR /copilot"
73- else
74- echo " Error: copilot binary not found in tarball" >&2
75- exit 1
61+ if [ -f " $INSTALL_DIR /copilot" ]; then
62+ echo " Notice: Replacing copilot binary found at $INSTALL_DIR /copilot."
7663fi
64+ tar -xz -C " $INSTALL_DIR " -f " $TMP_TARBALL "
65+ chmod +x " $INSTALL_DIR /copilot"
66+ echo " ✓ GitHub Copilot CLI installed to $INSTALL_DIR /copilot"
67+ rm -f " $TMP_TARBALL "
7768
7869# Check if install directory is in PATH
7970case " :$PATH :" in
0 commit comments