Skip to content

Instantly share code, notes, and snippets.

@utisam
Last active February 16, 2022 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utisam/f78916c83c58b5862c9d3aa4fe899749 to your computer and use it in GitHub Desktop.
Save utisam/f78916c83c58b5862c9d3aa4fe899749 to your computer and use it in GitHub Desktop.
#!/bin/zsh
SILENT=0
if [[ $1 = "-s" ]]; then
shift
SILENT=1
fi
declare -a COMMAND=(git --no-pager $argv)
if [[ $1 = "!" ]]; then
shift
COMMAND=($argv)
fi
for D in $(find -L $PWD \( -name vendor -o -name node_modules \) -prune -o -type d -name .git -print -prune)
do
cd $(dirname $D)
[[ $SILENT = 0 ]] && echo -e "\e[37;44;1m${PWD/${HOME}/~}\e[m"
$COMMAND[*]
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment