From 8650bb62920f86d88781ef14ff2eaf30dcfefbbd Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Sat, 1 Feb 2025 14:02:11 +0100 Subject: [PATCH] git_all multiple args in zsh --- scripts/util.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/util.sh b/scripts/util.sh index b4d1c84..d4886e0 100644 --- a/scripts/util.sh +++ b/scripts/util.sh @@ -60,9 +60,9 @@ run_in_dir() ( # Run a git command in all in the current directory and in top-level git subdirectories. # Usage: git_all commit | push | pull | fetch | status | branch ... git_all() ( - local cmd="$*" + local cmd=("$@") echo "$(pwd)" - (git $cmd) & + (git "${cmd[@]}") & jobs=($!) for dir in $(ls -d */); do @@ -70,7 +70,7 @@ git_all() ( echo "$dir" ( cd "$dir" || exit 1 - git $cmd + git "${cmd[@]}" ) & jobs+=($!) # Capture the PID of the background process fi @@ -96,7 +96,7 @@ clone_gitlab() ( fi git clone $URL - cd $repo + cd $repo set_branch git checkout $CODE_BRANCH 2>/dev/null || true )