Skip to content

Commit 8650bb6

Browse files
committed
git_all multiple args in zsh
1 parent 605e3c4 commit 8650bb6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/util.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ run_in_dir() (
6060
# Run a git command in all in the current directory and in top-level git subdirectories.
6161
# Usage: git_all commit | push | pull | fetch | status | branch ...
6262
git_all() (
63-
local cmd="$*"
63+
local cmd=("$@")
6464
echo "$(pwd)"
65-
(git $cmd) &
65+
(git "${cmd[@]}") &
6666
jobs=($!)
6767

6868
for dir in $(ls -d */); do
6969
if [ -d "$dir/.git" ]; then
7070
echo "$dir"
7171
(
7272
cd "$dir" || exit 1
73-
git $cmd
73+
git "${cmd[@]}"
7474
) &
7575
jobs+=($!) # Capture the PID of the background process
7676
fi
@@ -96,7 +96,7 @@ clone_gitlab() (
9696
fi
9797

9898
git clone $URL
99-
cd $repo
99+
cd $repo
100100
set_branch
101101
git checkout $CODE_BRANCH 2>/dev/null || true
102102
)

0 commit comments

Comments
 (0)