From defa2cd0da9a39b674a200f99f13472ec58abc60 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Thu, 4 Jul 2013 01:48:39 +0200 Subject: [PATCH] git auto pull --- git_auto_pull.sh | 28 ++++++++++++++++++++++++++++ install.sh | 1 + 2 files changed, 29 insertions(+) create mode 100755 git_auto_pull.sh diff --git a/git_auto_pull.sh b/git_auto_pull.sh new file mode 100755 index 0000000..b4b4a78 --- /dev/null +++ b/git_auto_pull.sh @@ -0,0 +1,28 @@ +#!/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 3 -type d -name ".git" | sed 's/\/.git\+$//'`; +do + cd $gitrepo + echo $gitrepo + git status + git pull 2>/dev/null + + #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 diff --git a/install.sh b/install.sh index d932349..c291e58 100755 --- a/install.sh +++ b/install.sh @@ -36,6 +36,7 @@ for i in `ls $WAI/vim/skeletons`; do ln -s $WAI/vim/skeletons/$i ./$i; done cd ~ if [ -d "Programmation" ]; then mkdir Programmation; fi; cd ~/Programmation +ln -s $WAI/git_auto_pull.sh ./git_auto_pull.sh if [ ! -d "./Utils" ]; then mkdir Utils; fi; cd ./Utils ln -s $WAI/Utils/monitor.sh ./monitor.sh