fix: handle Windows package subdirectory in CLI installation script (#3171)

This commit is contained in:
Max Novich
2025-06-30 10:20:32 -07:00
committed by GitHub
parent c5eb692efa
commit 9c8ce4f2d3
+21 -13
View File
@@ -161,11 +161,19 @@ set -e # Re-enable immediate exit on error
rm "$FILE" # clean up the downloaded archive rm "$FILE" # clean up the downloaded archive
# Determine the extraction directory (handle subdirectory in Windows packages)
# Windows releases may contain files in a 'goose-package' subdirectory
EXTRACT_DIR="$TMP_DIR"
if [ "$OS" = "windows" ] && [ -d "$TMP_DIR/goose-package" ]; then
echo "Found goose-package subdirectory, using that as extraction directory"
EXTRACT_DIR="$TMP_DIR/goose-package"
fi
# Make binary executable # Make binary executable
if [ "$OS" = "windows" ]; then if [ "$OS" = "windows" ]; then
chmod +x "$TMP_DIR/goose.exe" chmod +x "$EXTRACT_DIR/goose.exe"
else else
chmod +x "$TMP_DIR/goose" chmod +x "$EXTRACT_DIR/goose"
fi fi
# --- 5) Install to $GOOSE_BIN_DIR --- # --- 5) Install to $GOOSE_BIN_DIR ---
@@ -176,44 +184,44 @@ fi
echo "Moving goose to $GOOSE_BIN_DIR/$OUT_FILE" echo "Moving goose to $GOOSE_BIN_DIR/$OUT_FILE"
if [ "$OS" = "windows" ]; then if [ "$OS" = "windows" ]; then
mv "$TMP_DIR/goose.exe" "$GOOSE_BIN_DIR/$OUT_FILE" mv "$EXTRACT_DIR/goose.exe" "$GOOSE_BIN_DIR/$OUT_FILE"
else else
mv "$TMP_DIR/goose" "$GOOSE_BIN_DIR/$OUT_FILE" mv "$EXTRACT_DIR/goose" "$GOOSE_BIN_DIR/$OUT_FILE"
fi fi
# Also move temporal-service and temporal CLI if they exist # Also move temporal-service and temporal CLI if they exist
if [ "$OS" = "windows" ]; then if [ "$OS" = "windows" ]; then
if [ -f "$TMP_DIR/temporal-service.exe" ]; then if [ -f "$EXTRACT_DIR/temporal-service.exe" ]; then
echo "Moving temporal-service to $GOOSE_BIN_DIR/temporal-service.exe" echo "Moving temporal-service to $GOOSE_BIN_DIR/temporal-service.exe"
mv "$TMP_DIR/temporal-service.exe" "$GOOSE_BIN_DIR/temporal-service.exe" mv "$EXTRACT_DIR/temporal-service.exe" "$GOOSE_BIN_DIR/temporal-service.exe"
chmod +x "$GOOSE_BIN_DIR/temporal-service.exe" chmod +x "$GOOSE_BIN_DIR/temporal-service.exe"
fi fi
# Move temporal CLI if it exists # Move temporal CLI if it exists
if [ -f "$TMP_DIR/temporal.exe" ]; then if [ -f "$EXTRACT_DIR/temporal.exe" ]; then
echo "Moving temporal CLI to $GOOSE_BIN_DIR/temporal.exe" echo "Moving temporal CLI to $GOOSE_BIN_DIR/temporal.exe"
mv "$TMP_DIR/temporal.exe" "$GOOSE_BIN_DIR/temporal.exe" mv "$EXTRACT_DIR/temporal.exe" "$GOOSE_BIN_DIR/temporal.exe"
chmod +x "$GOOSE_BIN_DIR/temporal.exe" chmod +x "$GOOSE_BIN_DIR/temporal.exe"
fi fi
# Copy Windows runtime DLLs if they exist # Copy Windows runtime DLLs if they exist
for dll in "$TMP_DIR"/*.dll; do for dll in "$EXTRACT_DIR"/*.dll; do
if [ -f "$dll" ]; then if [ -f "$dll" ]; then
echo "Moving Windows runtime DLL: $(basename "$dll")" echo "Moving Windows runtime DLL: $(basename "$dll")"
mv "$dll" "$GOOSE_BIN_DIR/" mv "$dll" "$GOOSE_BIN_DIR/"
fi fi
done done
else else
if [ -f "$TMP_DIR/temporal-service" ]; then if [ -f "$EXTRACT_DIR/temporal-service" ]; then
echo "Moving temporal-service to $GOOSE_BIN_DIR/temporal-service" echo "Moving temporal-service to $GOOSE_BIN_DIR/temporal-service"
mv "$TMP_DIR/temporal-service" "$GOOSE_BIN_DIR/temporal-service" mv "$EXTRACT_DIR/temporal-service" "$GOOSE_BIN_DIR/temporal-service"
chmod +x "$GOOSE_BIN_DIR/temporal-service" chmod +x "$GOOSE_BIN_DIR/temporal-service"
fi fi
# Move temporal CLI if it exists # Move temporal CLI if it exists
if [ -f "$TMP_DIR/temporal" ]; then if [ -f "$EXTRACT_DIR/temporal" ]; then
echo "Moving temporal CLI to $GOOSE_BIN_DIR/temporal" echo "Moving temporal CLI to $GOOSE_BIN_DIR/temporal"
mv "$TMP_DIR/temporal" "$GOOSE_BIN_DIR/temporal" mv "$EXTRACT_DIR/temporal" "$GOOSE_BIN_DIR/temporal"
chmod +x "$GOOSE_BIN_DIR/temporal" chmod +x "$GOOSE_BIN_DIR/temporal"
fi fi
fi fi