fix: normalize Windows paths in update scope detection (#2278)
* docs: sync ARCHITECTURE.md command count to 74 commands/gsd/ has 74 .md files; the two count references in ARCHITECTURE.md still said 73. Fixes the command-count-sync regression test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: normalize Windows paths in update scope detection (#2232) On Windows with Git Bash, `pwd` returns POSIX-style /c/Users/... paths while execution_context carries Windows-style C:/Users/... paths. The string equality check for LOCAL vs GLOBAL install scope never matched, so every local install on Windows was misdetected as GLOBAL and the wrong (global) install was updated. Fix: normalize both paths to POSIX drive-letter form before comparing, using portable POSIX shell (case+printf+tr, no GNU extensions). Closes #2232 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(commands): add gsd:inbox command for GitHub issue/PR triage inbox.md was created but not committed, causing the command count to read 73 in git while ARCHITECTURE.md correctly stated 74. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -78,9 +78,27 @@ fi
|
|||||||
# runtime directories.
|
# runtime directories.
|
||||||
if [ -n "$PREFERRED_CONFIG_DIR" ] && { [ -f "$PREFERRED_CONFIG_DIR/get-shit-done/VERSION" ] || [ -f "$PREFERRED_CONFIG_DIR/get-shit-done/workflows/update.md" ]; }; then
|
if [ -n "$PREFERRED_CONFIG_DIR" ] && { [ -f "$PREFERRED_CONFIG_DIR/get-shit-done/VERSION" ] || [ -f "$PREFERRED_CONFIG_DIR/get-shit-done/workflows/update.md" ]; }; then
|
||||||
INSTALL_SCOPE="GLOBAL"
|
INSTALL_SCOPE="GLOBAL"
|
||||||
|
# Normalize a path for comparison: on Windows with Git Bash, pwd returns
|
||||||
|
# POSIX-style /c/Users/... but PREFERRED_CONFIG_DIR may carry C:/Users/...
|
||||||
|
# Convert Windows drive-letter paths to POSIX form so the comparison works
|
||||||
|
# on both Windows (Git Bash) and POSIX systems.
|
||||||
|
normalize_path() {
|
||||||
|
local p="$1"
|
||||||
|
case "$p" in
|
||||||
|
[A-Za-z]:/*)
|
||||||
|
local drive rest
|
||||||
|
drive="${p%%:*}"
|
||||||
|
rest="${p#?:}"
|
||||||
|
p="/$(printf '%s' "$drive" | tr '[:upper:]' '[:lower:]')$rest"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
printf '%s' "$p"
|
||||||
|
}
|
||||||
|
normalized_preferred="$(normalize_path "$PREFERRED_CONFIG_DIR")"
|
||||||
for dir in .claude .config/opencode .opencode .gemini .config/kilo .kilo .codex; do
|
for dir in .claude .config/opencode .opencode .gemini .config/kilo .kilo .codex; do
|
||||||
resolved_local="$(cd "./$dir" 2>/dev/null && pwd)"
|
resolved_local="$(cd "./$dir" 2>/dev/null && pwd)"
|
||||||
if [ -n "$resolved_local" ] && [ "$resolved_local" = "$PREFERRED_CONFIG_DIR" ]; then
|
normalized_local="$(normalize_path "$resolved_local")"
|
||||||
|
if [ -n "$normalized_local" ] && [ "$normalized_local" = "$normalized_preferred" ]; then
|
||||||
INSTALL_SCOPE="LOCAL"
|
INSTALL_SCOPE="LOCAL"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user