dotfiles/git_auto_pull.sh

38 lines
666 B
Bash
Raw Normal View History

2013-07-03 23:48:39 +00:00
#!/bin/bash
red='\033[31m'
green='\033[32m'
RED='\033[31m\033[01m'
blue='\033[34m'
BLUE='\033[34m'
cyan='\033[36m'
CYAN='\033[36m'
magenta='\033[35m'
DFT='\033[0m'
white='\033[37m'
for gitrepo in `find ./ -maxdepth 4 -type d -name ".git" | sed 's/\/.git\+$//'`;
2013-07-03 23:48:39 +00:00
do
cd $gitrepo
2013-07-27 17:09:01 +00:00
if [ -e do_not_auto_check ]; then
cd - > /dev/null
continue
fi;
2013-07-30 23:14:50 +00:00
echo $gitrepo
2013-07-03 23:48:39 +00:00
git status
2013-07-30 23:14:50 +00:00
#echo $A | grep "working directory clean"
#if [ $? -eq 1 ]; then
git pull 2>/dev/null
#fi;
2013-07-03 23:48:39 +00:00
#RESULT=`git pull 2>/dev/null`
#if [ !`echo $RESULT | grep "up to date"` ]; then
# echo -e "$green up to date $DFT"
#else
# echo $RESULT
#fi;
cd - > /dev/null
echo "==========="
done