mirror of
https://github.com/OthmanAdi/planning-with-files.git
synced 2026-04-25 16:06:02 +03:00
[PR #86] [MERGED] fix: Stop hook fails on Windows — multiline YAML command not parsed by Git Bash #85
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/planning-with-files#85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/OthmanAdi/planning-with-files/pull/86
Author: @raykuo998
Created: 2/27/2026
Status: ✅ Merged
Merged: 2/28/2026
Merged by: @OthmanAdi
Base:
master← Head:fix/windows-stop-hook-multiline📝 Commits (2)
f2f0547fix: Stop hook fails on Windows — multiline YAML command not parsed by Git Bash6cc1584fix: restore mastracode relative-path fallback for project-local installs📊 Changes
7 files changed (+7 additions, -176 deletions)
View changed files
📝
.codebuddy/skills/planning-with-files/SKILL.md(+1 -25)📝
.codex/skills/planning-with-files/SKILL.md(+1 -25)📝
.cursor/skills/planning-with-files/SKILL.md(+1 -25)📝
.kilocode/skills/planning-with-files/SKILL.md(+1 -25)📝
.mastracode/skills/planning-with-files/SKILL.md(+1 -26)📝
.opencode/skills/planning-with-files/SKILL.md(+1 -25)📝
skills/planning-with-files/SKILL.md(+1 -25)📄 Description
Summary
command: |) with a ~25-line bash script for OS detection. On Windows, Claude Code passes hook commands through Git Bash, which fails to parse the multiline content —SCRIPT_DIR=...is interpreted as a command name instead of a variable assignmentSDvariable inline, trypowershell.exefirst (Windows), fall back tosh(Linux/macOS). The OS-detection logic is eliminated entirely since the fallback chain handles it implicitlyError on Windows (before fix)
Root Cause
YAML
command: |multiline blocks are not reliably parsed by Git Bash on Windows. The shell receives the first line (SCRIPT_DIR=...) as a command to execute rather than a variable assignment, causing the entire hook to fail.Fix
Before (25 lines per variant):
After (1 line per variant):
Test plan
check-complete.ps1runs correctly via powershell.exe on Windowscheck-complete.shruns correctly via sh on Linux/macOS (powershell.exe not found, falls through to sh)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.