Skip to content

Commit 43b3d55

Browse files
iamaeroplaneclaude
andcommitted
fix: use cd -- to handle paths starting with dash
Prevents cd from interpreting directory names like -P or -L as options. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 334df41 commit 43b3d55

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/bash/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
find_specify_root() {
77
local dir="${1:-$(pwd)}"
88
# Normalize to absolute path to prevent infinite loop with relative paths
9-
dir="$(cd "$dir" 2>/dev/null && pwd)" || return 1
9+
# Use -- to handle paths starting with - (e.g., -P, -L)
10+
dir="$(cd -- "$dir" 2>/dev/null && pwd)" || return 1
1011
local prev_dir=""
1112
while true; do
1213
if [ -d "$dir/.specify" ]; then

0 commit comments

Comments
 (0)