Files
shell-scripts/fetch-all.sh
T
2019-11-15 19:27:27 +00:00

21 lines
512 B
Bash
Executable File

#!/bin/bash
# perform a "git fetch" on each location specified
# fetch-all.sh ~/project [~/second-project]
function process_git_fetch () {
BOB=`pwd`
for location in "$@"; do
if [ -d "$location/.git" ]; then
echo -n "----- git fetch $location "
printf "%*.*s" 0 $((40 - ${#location} )) "----------------------------------------"
echo "-----"
cd "$location"
git fetch --prune
fi
done
cd "$BOB"
}
process_git_fetch "$@"