Sitelet https://github.com/divegeek/uscode/commit/6a9333965149a1aae960d71ce8acc23b5245862f
Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

Commit 6a93339

Browse files
committed
Updated to accurately detect changes (the return value of
git status isn't useful for that, apparently).
1 parent 4b58eca commit 6a93339

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

‎src/update_uscode.sh‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
#!/bin/sh
2-
date
3-
pushd ~/sources/uscode
4-
git pull origin master
2+
LOGFILE=~/log/uscode.log
3+
touch $LOGFILE
4+
date >> $LOGFILE
5+
cd ~/sources/uscode
6+
git pull -q origin master
57
rm -rf code
6-
python /home/shawn/sources/uscode/src/retrieve_code.py .
7-
git add code
8-
git status > /dev/null
8+
python /home/shawn/sources/uscode/src/retrieve_code.py . >> $LOGFILE
9+
git add code >> $LOGFILE
10+
DIFFLOG=`git status --porcelain`
911
if [ $? -eq 0 ]; then
10-
git commit -m "`date`" -a
12+
echo "$DIFFLOG" >> $LOGFILE
13+
git commit -m "`date`"
1114
git tag -f -a -m "Daily tag" `date +"%F"`
1215
git push --tags origin master
1316
fi
14-
popd
17+

0 commit comments

Comments
 (0)