From 00922df362d849ecc39c0f6b28839eabbf68824e Mon Sep 17 00:00:00 2001 From: kuderr Date: Wed, 25 Feb 2026 15:24:16 +0300 Subject: [PATCH] fix: use pure bash in wtn to avoid grep/awk dependency The wtn function ran in a shell context where grep and awk may not be in PATH. Replaced with read-based parsing. Co-Authored-By: Claude Opus 4.6 --- aliases/git-wt.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aliases/git-wt.sh b/aliases/git-wt.sh index e5c32b1..3de4197 100644 --- a/aliases/git-wt.sh +++ b/aliases/git-wt.sh @@ -24,12 +24,16 @@ wto() { # wtn (auto-generated name) # wtn -b main hotfix wtn() { - local output + local output line path output=$(git wt new "$@") || return 1 echo "$output" - local path - path=$(echo "$output" | grep 'Path:' | awk '{print $2}') - [[ -n "$path" ]] && cd "$path" || return 1 + while IFS= read -r line; do + if [[ "$line" == *"Path:"* ]]; then + read -r path <<< "${line##*Path:}" + break + fi + done <<< "$output" + [[ -n "${path:-}" ]] && cd "$path" || return 1 } # List worktrees (current repo)