Skip to content

Commit

Permalink
fix: install Windows executable with install.sh in Git Bash (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdblischak authored Mar 12, 2024
1 parent 90438fd commit 2b3607a
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ if [[ $PLATFORM == "Darwin" ]]; then
PLATFORM="apple-darwin"
elif [[ $PLATFORM == "Linux" ]]; then
PLATFORM="unknown-linux-musl"
elif [[ $(uname -o) == "Msys" ]]; then
PLATFORM="pc-windows-msvc"
fi

if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then
Expand All @@ -24,11 +26,15 @@ fi


BINARY="pixi-${ARCH}-${PLATFORM}"
EXTENSION="tar.gz"
if [[ $(uname -o) == "Msys" ]]; then
EXTENSION="zip"
fi

if [[ $VERSION == "latest" ]]; then
DOWNLOAD_URL=https://github.com/${REPO}/releases/latest/download/${BINARY}.tar.gz
DOWNLOAD_URL=https://github.com/${REPO}/releases/latest/download/${BINARY}.${EXTENSION}
else
DOWNLOAD_URL=https://github.com/${REPO}/releases/download/${VERSION}/${BINARY}.tar.gz
DOWNLOAD_URL=https://github.com/${REPO}/releases/download/${VERSION}/${BINARY}.${EXTENSION}
fi

printf "This script will automatically download and install Pixi (${VERSION}) for you.\nGetting it from this url: $DOWNLOAD_URL\n"
Expand Down Expand Up @@ -71,10 +77,15 @@ if [[ ! -s $TEMP_FILE ]]; then
exit 1
fi

# Extract pixi from the downloaded tar file
# Extract pixi from the downloaded file
mkdir -p "$BIN_DIR"
tar -xzf "$TEMP_FILE" -C "$BIN_DIR"
chmod +x "$BIN_DIR/pixi"
if [[ $(uname -o) == "Msys" ]]; then
unzip "$TEMP_FILE" -d "$BIN_DIR"
else
tar -xzf "$TEMP_FILE" -C "$BIN_DIR"
chmod +x "$BIN_DIR/pixi"
fi

echo "The 'pixi' binary is installed into '${BIN_DIR}'"

update_shell() {
Expand Down

0 comments on commit 2b3607a

Please # to comment.