-
-
Save kaeza/309e5230bf183049b7394b309c9361b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
cd "$(dirname "$0")"; | |
errs=""; | |
nl=' | |
'; | |
for dir in *; do | |
[[ -d "$dir/.git" ]] && { | |
echo "GIT $dir"; | |
pushd "$dir"; | |
[[ "$(git branch | grep '^\* .*' | cut -c 3-)" = "master" ]] && { | |
git pull origin master || errs="$errs$dir$nl"; | |
} | |
popd; | |
} || git branch | grep '^\* .*' | cut -c 3-; | |
done | |
[[ "$errs" ]] && echo -ne "Errors:$nl$errs"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment