Created
May 18, 2014 20:54
-
-
Save JackMc/fc955fc1d4977186dfea to your computer and use it in GitHub Desktop.
Updates my sources folder
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
bold=`tput bold` | |
normal=`tput sgr0` | |
touch .errors | |
for d in */ | |
do | |
echo "Processing $d" | |
cd "$d" | |
if [ -d .git ] | |
then | |
git pull > /dev/null 2> .error | |
elif [ -d .svn ] | |
then | |
svn update > /dev/null 2> .error | |
elif [ -d .hg ] | |
then | |
hg pull > /dev/null 2> .error | |
hg update > /dev/null 2> .error | |
elif [ -d .bzr ] | |
then | |
bzr pull > /dev/null 2> .error | |
fi | |
if [ -s .error ] | |
then | |
a=`cat .error` | |
echo -e "${bold}$d${normal}:\n$a" >> ../.errors | |
fi | |
rm -f .error | |
cd .. | |
done | |
if [ -s .errors ] | |
then | |
echo -e "\n${bold}Errors from pulls/updates:${normal}\n" | |
cat .errors | |
else | |
echo -e "\n${bold}Finished with no errors :)${normal}\n" | |
fi | |
rm .errors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment