From b80872a49c989c0b4a3f34dd43a64e13adf5e679 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Dec 2024 14:28:00 +0000 Subject: [PATCH] Update install scripts from main --- install.ps1 | 2 +- install.sh | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/install.ps1 b/install.ps1 index 4872675a8..9de9f2fe1 100644 --- a/install.ps1 +++ b/install.ps1 @@ -18,7 +18,7 @@ .LINK https://github.com/prefix-dev/pixi .NOTES - Version: v0.39.1 + Version: v0.39.2 #> param ( [string] $PixiVersion = 'latest', diff --git a/install.sh b/install.sh index fc0987ee8..fe9dee837 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -# Version: v0.39.1 +# Version: v0.39.2 __wrap__() { @@ -93,8 +93,19 @@ mkdir -p "$BIN_DIR" if [[ "$(uname -o)" == "Msys" ]]; then unzip "$TEMP_FILE" -d "$BIN_DIR" else - tar -xzf "$TEMP_FILE" -C "$BIN_DIR" + # Extract to a temporary directory first + TEMP_DIR=$(mktemp -d) + tar -xzf "$TEMP_FILE" -C "$TEMP_DIR" + + # Find and move the `pixi` binary, making sure to handle the case where it's in a subdirectory + if [[ -f "$TEMP_DIR/pixi" ]]; then + mv "$TEMP_DIR/pixi" "$BIN_DIR/" + else + mv "$(find "$TEMP_DIR" -type f -name pixi)" "$BIN_DIR/" + fi + chmod +x "$BIN_DIR/pixi" + rm -rf "$TEMP_DIR" fi echo "The 'pixi' binary is installed into '${BIN_DIR}'"