1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 22:55:10 +01:00

Removed the per-group config file loop

This commit is contained in:
Michiel Scholten
2014-07-19 16:43:15 +02:00
parent 6878d117c0
commit 030dc90c67

View File

@@ -37,32 +37,21 @@ for LINE in "${LINES[@]}"; do
exit 1 exit 1
fi fi
if [ -e ~/.git_group_$GRP ]; then cd $WORKSPACE/$GRP
saveIFS="$IFS" REPODIR=$(basename "$REPO")
IFS=$'\n' #extension="${filename##*.}"
REPOS=($(<~/.git_group_$GRP)) REPODIR="${REPODIR%.*}"
IFS="$saveIFS" if [ -e $REPODIR ]; then
cd $REPODIR
for REPO in "${REPOS[@]}"; do if ! git diff --quiet; then
cd $WORKSPACE/$GRP echo -e "[\e[31mX\e[0m] $GRP/$REPODIR changed - $WORKSPACE/$GRP/$REPODIR"
REPODIR=$(basename "$REPO") else
#extension="${filename##*.}" echo -e "[\e[32mU\e[0m] $GRP/$REPODIR"
REPODIR="${REPODIR%.*}" git pull --quiet
if [ -e $REPODIR ]; then git push --quiet
cd $REPODIR fi
if ! git diff --quiet; then
echo -e "[\e[31mX\e[0m] $GRP/$REPODIR changed - $WORKSPACE/$GRP/$REPODIR"
else
echo -e "[\e[32mU\e[0m] $GRP/$REPODIR"
git pull --quiet
git push --quiet
fi
else
echo -e "[\e[33mC\e[0m] $GRP/$REPODIR"
git clone --quiet $REPO
fi
done
else else
echo -e "[\e[31mX\e[0m] Group config file ~/.git_group_$GRP not found" echo -e "[\e[33mC\e[0m] $GRP/$REPODIR"
git clone --quiet $REPO
fi fi
done done