Skip to content

Commit

Permalink
git_all multiple args in zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
krystophny committed Feb 1, 2025
1 parent 605e3c4 commit 8650bb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ 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
if [ -d "$dir/.git" ]; then
echo "$dir"
(
cd "$dir" || exit 1
git $cmd
git "${cmd[@]}"
) &
jobs+=($!) # Capture the PID of the background process
fi
Expand All @@ -96,7 +96,7 @@ clone_gitlab() (
fi

git clone $URL
cd $repo
cd $repo
set_branch
git checkout $CODE_BRANCH 2>/dev/null || true
)
Expand Down

0 comments on commit 8650bb6

Please sign in to comment.