From 13314515bbf88f21b0b5b5cf835a479fbf75c719 Mon Sep 17 00:00:00 2001 From: aegntic Date: Wed, 22 Oct 2025 06:39:34 +1100 Subject: [PATCH] fix: use Windows-compatible default path for CLI installation (#5221) Signed-off-by: aegntic Co-authored-by: aegntic Co-authored-by: Claude --- download_cli.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/download_cli.sh b/download_cli.sh index 30a142ef5b..f984dbfa02 100755 --- a/download_cli.sh +++ b/download_cli.sh @@ -54,7 +54,23 @@ fi # --- 2) Variables --- REPO="block/goose" OUT_FILE="goose" -GOOSE_BIN_DIR="${GOOSE_BIN_DIR:-"$HOME/.local/bin"}" + +# Set default bin directory based on detected OS environment +if [[ "${WINDIR:-}" ]] || [[ "${windir:-}" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then + # Native Windows environments - use Windows user profile path + DEFAULT_BIN_DIR="$USERPROFILE/goose" +elif [[ -f "/proc/version" ]] && grep -q "Microsoft\|WSL" /proc/version 2>/dev/null; then + # WSL - use Linux-style path but make sure it exists + DEFAULT_BIN_DIR="$HOME/.local/bin" +elif [[ "$PWD" =~ ^/mnt/[a-zA-Z]/ ]]; then + # WSL mount point detection + DEFAULT_BIN_DIR="$HOME/.local/bin" +else + # Default for Linux/macOS + DEFAULT_BIN_DIR="$HOME/.local/bin" +fi + +GOOSE_BIN_DIR="${GOOSE_BIN_DIR:-$DEFAULT_BIN_DIR}" RELEASE="${CANARY:-false}" CONFIGURE="${CONFIGURE:-true}" if [ -n "${GOOSE_VERSION:-}" ]; then