Skip to content
Merged
6 changes: 3 additions & 3 deletions bin/git-bulk
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@ function executBulkOp () {
listall | while read -r workspacespec; do
parseWsName "$workspacespec"
if [[ -n $wsname ]] && [[ $rwsname != "$wsname" ]]; then continue; fi
eval cd "\"$rwsdir\""
eval cd "\"$rwsdir\"" || exit 1
local actual=$PWD
[ "${quiet?}" != "true" ] && echo 1>&2 "Executing bulk operation in workspace ${inverse}$actual${reset}"

allGitFolders=( $(eval find -L . -name ".git") )

for line in "${allGitFolders[@]}"; do
local gitrepodir=${line::${#line}-5} # cut the .git part of find results to have the root git directory of that repository
eval cd "\"$gitrepodir\"" # into git repo location
eval cd "\"$gitrepodir\"" || exit 1 # into git repo location
local curdir=$PWD
local leadingpath=${curdir#"${actual}"}
guardedExecution "$@"
eval cd "\"$rwsdir\"" # back to origin location of last find command
eval cd "\"$rwsdir\"" || exit 1 # back to origin location of last find command
done
done
}
Expand Down
Loading