Skip to content

Commit

Permalink
Modified testing of status
Browse files Browse the repository at this point in the history
Apparently, the exit code from "git status" isn't useful.  However,
with the --porcelain option, it produces no output if there are no
changes, so I changed the script to test for output.
  • Loading branch information
divegeek committed May 29, 2012
1 parent bb80dfa commit 087eb61
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/update_utahcode.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/sh
LOGFILE=~/log/utahcode.log
touch $LOGFILE
date >> $LOGFILE
Expand All @@ -7,9 +7,10 @@ git pull -q origin master
rm -rf code constitution
python /home/shawn/sources/utahcode/src/retrieve_code.py . >> $LOGFILE
git add code constitution >> $LOGFILE
git status >> $LOGFILE
if [ $? -eq 0 ]; then
git commit -m "`date`" -a
DIFFLOG=`git status --porcelain`
if [ ! -z "$DIFFLOG" ]; then
echo "$DIFFLOG" >> $LOGFILE
git commit -m "`date`"
git tag -f -a -m "Daily tag" `date +"%F"`
git push --tag origin master
fi
fi

0 comments on commit 087eb61

Please sign in to comment.