Skip to content

Commit 8951647

Browse files
committed
Fix remaining install/update gaps + in-memory zip extraction
Install command: - Add cbm_kill_other_instances() to kill stale MCP servers - Add cbm_macos_adhoc_sign() to sign binary if placed unsigned Update command: - Replace skills-only reinstall with full cbm_install_agent_configs() - Replace external unzip with cbm_extract_binary_from_zip() via zlib Refactor: extract 10-agent config loop into cbm_install_agent_configs() called by both install and update. New: cbm_extract_binary_from_zip() — in-memory zip extraction with stored + deflate support, path traversal rejection, bounds checks. 4 unit tests. Smoke: add install.ps1 E2E for Windows.
1 parent 006e6db commit 8951647

4 files changed

Lines changed: 437 additions & 102 deletions

File tree

scripts/smoke-test.sh

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,53 @@ if [ "$DL_OS" != "windows" ] && [ -f "$REPO_ROOT/install.sh" ]; then
11991199
fi
12001200

12011201
rm -rf "$INSTALL_TEST_HOME" "$INSTALL_TEST_DIR"
1202+
1203+
elif [ -f "$REPO_ROOT/install.ps1" ] && command -v powershell.exe &>/dev/null; then
1204+
echo "--- Phase 13: install.ps1 E2E (Windows) ---"
1205+
PS1_TEST_HOME=$(mktemp -d)
1206+
PS1_TEST_DIR=$(mktemp -d)
1207+
mkdir -p "$PS1_TEST_HOME/.claude"
1208+
1209+
# Convert MSYS paths to Windows paths for PowerShell
1210+
if command -v cygpath &>/dev/null; then
1211+
WIN_DIR=$(cygpath -w "$PS1_TEST_DIR")
1212+
WIN_URL="$SMOKE_DOWNLOAD_URL"
1213+
WIN_SCRIPT=$(cygpath -w "$REPO_ROOT/install.ps1")
1214+
WIN_HOME=$(cygpath -w "$PS1_TEST_HOME")
1215+
else
1216+
WIN_DIR="$PS1_TEST_DIR"
1217+
WIN_URL="$SMOKE_DOWNLOAD_URL"
1218+
WIN_SCRIPT="$REPO_ROOT/install.ps1"
1219+
WIN_HOME="$PS1_TEST_HOME"
1220+
fi
1221+
1222+
# 13f: run install.ps1
1223+
HOME="$PS1_TEST_HOME" CBM_DOWNLOAD_URL="$WIN_URL" \
1224+
powershell.exe -ExecutionPolicy ByPass -File "$WIN_SCRIPT" "--dir=$WIN_DIR" 2>&1 || true
1225+
1226+
# 13g: binary placed
1227+
PS1_BIN="$PS1_TEST_DIR/codebase-memory-mcp.exe"
1228+
if [ ! -f "$PS1_BIN" ] && [ -f "$PS1_TEST_DIR/codebase-memory-mcp" ]; then
1229+
PS1_BIN="$PS1_TEST_DIR/codebase-memory-mcp"
1230+
fi
1231+
if [ -f "$PS1_BIN" ]; then
1232+
echo "OK 13g: binary placed by install.ps1"
1233+
else
1234+
echo "FAIL 13g: binary not placed by install.ps1"
1235+
exit 1
1236+
fi
1237+
1238+
# 13h: binary runs
1239+
if "$PS1_BIN" --version > /dev/null 2>&1; then
1240+
echo "OK 13h: binary runs"
1241+
else
1242+
echo "FAIL 13h: installed binary doesn't run"
1243+
exit 1
1244+
fi
1245+
1246+
rm -rf "$PS1_TEST_HOME" "$PS1_TEST_DIR"
12021247
else
1203-
echo "SKIP Phase 13: install script not available for this platform"
1248+
echo "SKIP Phase 13: no install script available for this platform"
12041249
fi
12051250

12061251
else

0 commit comments

Comments
 (0)