From 2b2b975e688f8edba6af9717b28d41d1ef620190 Mon Sep 17 00:00:00 2001 From: vonavi Date: Wed, 9 Oct 2013 11:22:53 +0300 Subject: [PATCH] Check if game results have been changed. --- mktable | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/mktable b/mktable index 57581bf..bbb167a 100755 --- a/mktable +++ b/mktable @@ -9,14 +9,19 @@ git checkout master ./tour-parse > $results git add $results git commit -m "Update game results." +# Successful `git commit' returns exit code `0' +ret_code=$? -# 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 +if [[ $ret_code == 0 ]]; then -# Check the difference between game results -git diff HEAD^ HEAD -- $results + # 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 + + # Check the difference between game results + git diff HEAD^ HEAD -- $results +fi