mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
feat: pass origin argument down to git execution
This commit is contained in:
parent
e9668cc04b
commit
9683fb6510
11
bin/git-bulk
11
bin/git-bulk
|
|
@ -61,15 +61,15 @@ function guardedExecution () {
|
|||
if $guardedmode; then
|
||||
echo -n "${inverse}git $gitcommand${reset} -> execute here (y/n)? "
|
||||
read -n 1 -r </dev/tty; echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then atomicExecution; fi
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then atomicExecution "$@"; fi
|
||||
else
|
||||
atomicExecution
|
||||
atomicExecution "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# atomic git command execution with log
|
||||
function atomicExecution () {
|
||||
echo "${bldred}->${reset} executing ${inverse}git $gitcommand${reset}" && git $gitcommand
|
||||
echo "${bldred}->${reset} executing ${inverse}git $gitcommand${reset}" && git "$@"
|
||||
}
|
||||
|
||||
# check if the passed command is known as a core git command
|
||||
|
|
@ -138,7 +138,7 @@ function executBulkOp () {
|
|||
local curdir=$(pwd)
|
||||
local leadingpath=${curdir#${actual}}
|
||||
echo "Current repository: ${leadingpath%/*}/${bldred}${curdir##*/}${reset}"
|
||||
guardedExecution
|
||||
guardedExecution "$@"
|
||||
eval cd "\"$rwsdir\"" # back to origin location of last find command
|
||||
done
|
||||
done
|
||||
|
|
@ -184,4 +184,5 @@ case $butilcommand in
|
|||
addworkspace) allowedargcount 3 5;;
|
||||
esac
|
||||
|
||||
$butilcommand # run user command
|
||||
# pass the origin arguments to the 'executBulkOp'
|
||||
$butilcommand "$@" # run user command
|
||||
|
|
|
|||
Loading…
Reference in a new issue