lorchess/mktable

29 lines
646 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
YEAR=2013
TOURNAMENT=3-autumn
RESULTS=$YEAR/$TOURNAMENT/results.yml
TABLE=_includes/$TOURNAMENT/table.html
# Update game results
git checkout master
./tour-parse > $RESULTS
git add $RESULTS
git commit -m "Update game results."
# Successful `git commit' returns exit code `0'
ret_code=$?
if [[ $ret_code == 0 ]]; then
2013-10-09 13:44:33 +04:00
# Check the difference between game results
git diff HEAD^ HEAD -- $RESULTS
2013-10-09 13:44:33 +04:00
# Update the tournament table
bin/lorchess > temp_table.html
git checkout gh-pages
mv temp_table.html $TABLE
git add $TABLE
git commit -m "Update the tournament table."
git checkout master
fi