Skip to content

Commit 3a457d9

Browse files
committed
Fix smoke: Windows .exe binary name, UI variant archive fallback
1 parent b680129 commit 3a457d9

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

scripts/smoke-test.sh

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,17 +504,22 @@ fi
504504
# KiloCode detection always uses ~/.config/ path (even on macOS)
505505
mkdir -p "$FAKE_HOME/.config/Code/User/globalStorage/kilocode.kilo-code/settings"
506506
mkdir -p "$FAKE_HOME/.local/bin"
507-
cp "$BINARY" "$FAKE_HOME/.local/bin/codebase-memory-mcp"
508-
printf '#!/bin/sh\necho stub\n' > "$FAKE_HOME/.local/bin/aider" && chmod +x "$FAKE_HOME/.local/bin/aider"
509-
printf '#!/bin/sh\necho stub\n' > "$FAKE_HOME/.local/bin/opencode" && chmod +x "$FAKE_HOME/.local/bin/opencode"
507+
# Copy binary with correct name for platform
508+
if [[ "$BINARY" == *.exe ]]; then
509+
cp "$BINARY" "$FAKE_HOME/.local/bin/codebase-memory-mcp.exe"
510+
SELF_PATH="$FAKE_HOME/.local/bin/codebase-memory-mcp.exe"
511+
else
512+
cp "$BINARY" "$FAKE_HOME/.local/bin/codebase-memory-mcp"
513+
SELF_PATH="$FAKE_HOME/.local/bin/codebase-memory-mcp"
514+
fi
515+
printf '#!/bin/sh\necho stub\n' > "$FAKE_HOME/.local/bin/aider" && chmod +x "$FAKE_HOME/.local/bin/aider" 2>/dev/null || true
516+
printf '#!/bin/sh\necho stub\n' > "$FAKE_HOME/.local/bin/opencode" && chmod +x "$FAKE_HOME/.local/bin/opencode" 2>/dev/null || true
510517

511518
# Pre-existing configs (verify merge, not overwrite)
512519
echo '{"existingKey": true}' > "$FAKE_HOME/.claude.json"
513520
echo '{"existingKey": true}' > "$FAKE_HOME/.gemini/settings.json"
514521
printf '[existing_section]\nline_from_user = true\n' > "$FAKE_HOME/.codex/config.toml"
515522

516-
SELF_PATH="$FAKE_HOME/.local/bin/codebase-memory-mcp"
517-
518523
# Run install
519524
HOME="$FAKE_HOME" PATH="$FAKE_HOME/.local/bin:$PATH" "$BINARY" install -y 2>&1 || true
520525

@@ -1131,13 +1136,20 @@ if [ "$DL_OS" = "darwin" ] || [ "$DL_OS" = "linux" ]; then
11311136
else
11321137
DL_EXT="zip"
11331138
fi
1139+
# Try standard name first, fall back to UI variant
11341140
DL_ARCHIVE="codebase-memory-mcp-${DL_OS}-${DL_ARCH}.${DL_EXT}"
1141+
DL_ARCHIVE_UI="codebase-memory-mcp-ui-${DL_OS}-${DL_ARCH}.${DL_EXT}"
11351142

1136-
# 12a: curl download
1143+
# 12a: curl download (try standard, then UI variant)
11371144
echo "--- Phase 12a: curl download ---"
1138-
if ! curl -fSL -o "$DL_DIR/$DL_ARCHIVE" "$SMOKE_DOWNLOAD_URL/$DL_ARCHIVE"; then
1139-
echo "FAIL 12a: curl download failed"
1140-
exit 1
1145+
if ! curl -fSL -o "$DL_DIR/$DL_ARCHIVE" "$SMOKE_DOWNLOAD_URL/$DL_ARCHIVE" 2>/dev/null; then
1146+
# Try UI variant
1147+
if curl -fSL -o "$DL_DIR/$DL_ARCHIVE_UI" "$SMOKE_DOWNLOAD_URL/$DL_ARCHIVE_UI" 2>/dev/null; then
1148+
DL_ARCHIVE="$DL_ARCHIVE_UI"
1149+
else
1150+
echo "FAIL 12a: curl download failed (tried standard and ui variants)"
1151+
exit 1
1152+
fi
11411153
fi
11421154
if [ ! -s "$DL_DIR/$DL_ARCHIVE" ]; then
11431155
echo "FAIL 12a: downloaded archive is empty"

0 commit comments

Comments
 (0)