From 8a24e9b253a61ac6b45255258f17bd867cf757a7 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Thu, 17 Jul 2014 20:56:36 +0200 Subject: [PATCH] Copied git-update script that's under construction to public repo --- bin/update_repos | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 bin/update_repos diff --git a/bin/update_repos b/bin/update_repos new file mode 100755 index 0000000..fe01dac --- /dev/null +++ b/bin/update_repos @@ -0,0 +1,31 @@ +#!/bin/bash + +#value=`cat config.txt` +#echo "$value" + +WORKSPACE="$HOME/workspace/projects" + +if [ ! -e $WORKSPACE ]; then + mkdir -p $WORKSPACE +fi + +GITHUBUSER=aquatix +REPOS="dotfiles ns-api" + +for REPO in $REPOS; do + cd $WORKSPACE/github + if [ -e $REPO ]; then + cd $REPO + #git diff --quiet || echo "[c] skipping" + git diff --quiet + if [ $? > 0 ]; then + echo -e "[\e[31mX\e[0m] $REPO changed - $WORKSPACE/github/$REPO" + else + echo -e "[\e[32mU\e[0m] $REPO" + #git pull + fi + else + #git clone $REPO + echo -e "[\e[33mC\e[0m] $REPO" + fi +done