From e4626b904033584f9ec94da8457b84bfc43b21ac Mon Sep 17 00:00:00 2001 From: Rudy Celekli Date: Tue, 29 Sep 2026 12:52:22 -0400 Subject: [PATCH] fix(install): honor --path for Windsurf rules --- scripts/install.sh | 4 +++- scripts/test-install.sh | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 8fde392a..af9534d8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1014,8 +1014,10 @@ install_aider() { install_windsurf() { local src="$INTEGRATIONS/windsurf/.windsurfrules" - local dest="${PWD}/.windsurfrules" + local dest_dir; dest_dir="$(resolve_dest windsurf "$PWD")" + local dest="$dest_dir/.windsurfrules" [[ -f "$src" ]] || { err "integrations/windsurf/.windsurfrules missing. Run convert.sh first."; return 1; } + mkdir -p "$dest_dir" if [[ -f "$dest" ]]; then warn "Windsurf: .windsurfrules already exists at $dest (remove to reinstall)." return 0 diff --git a/scripts/test-install.sh b/scripts/test-install.sh index 5aeb290d..72b2886c 100755 --- a/scripts/test-install.sh +++ b/scripts/test-install.sh @@ -288,6 +288,22 @@ assert_eq "$TOTAL_AGENTS" "$(count_md "$dest")" "installs into a path containing assert_eq 0 "$(find "$home" -maxdepth 1 -name 'My' -o -maxdepth 1 -name 'Agents' | wc -l | tr -d ' ')" \ "a spaced path is not split into separate directories" +# Windsurf's --path is a directory override, just like Aider's. A caller may +# run this from another project, so installing into PWD silently edits the +# wrong project's .windsurfrules. +home="$(sandbox windsurf-path)" +work="$home/current project" +dest="$home/target project/rules" +mkdir -p "$work" +(cd "$work" && HOME="$home" bash "$INSTALL" --no-interactive --tool windsurf --path "$dest" > "$home/windsurf.log" 2>&1) +assert_eq 0 "$?" "Windsurf --path install exits successfully" +[[ -f "$dest/.windsurfrules" ]] \ + && pass "Windsurf --path installs into the requested directory" \ + || fail "Windsurf --path installs into the requested directory" +[[ ! -e "$work/.windsurfrules" ]] \ + && pass "Windsurf --path leaves the current project alone" \ + || fail "Windsurf --path leaves the current project alone" + # --------------------------------------------------------------------------- # 4b. Parallel workers get their arguments intact (PR #755) #