fix(install): honor --path for Windsurf rules

This commit is contained in:
Rudy Celekli
2026-09-29 12:52:22 -04:00
parent 765dbfb652
commit e4626b9040
2 changed files with 19 additions and 1 deletions
+3 -1
View File
@@ -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
+16
View File
@@ -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)
#