Skip to content

Commit c7f74d9

Browse files
committed
Remove download dir
1 parent 433ff32 commit c7f74d9

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

install.sh

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ esac
2727
DOWNLOAD_URL="https://github.com/github/copilot-cli/releases/latest/download/copilot-${PLATFORM}-${ARCH}.tar.gz"
2828
echo "Downloading from: $DOWNLOAD_URL"
2929

30-
DOWNLOAD_DIR="${HOME}/.copilot"
31-
mkdir -p "$DOWNLOAD_DIR"
32-
3330
# Download and extract with error handling
3431
TMP_TARBALL="$(mktemp)"
3532
if 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
4946
fi
5047

51-
tar -xz -C "$DOWNLOAD_DIR" -f "$TMP_TARBALL"
52-
rm -f "$TMP_TARBALL"
5348
if [ "$(id -u 2>/dev/null || echo 1)" -eq 0 ]; then
5449
PREFIX="${PREFIX:-/usr/local}"
5550
else
@@ -63,17 +58,13 @@ if ! mkdir -p "$INSTALL_DIR"; then
6358
fi
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."
7663
fi
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
7970
case ":$PATH:" in

0 commit comments

Comments
 (0)