From b0537fbe57eb2a908022a2264aa3aa1cc3eadf99 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Sat, 7 Jan 2012 11:17:31 -0600 Subject: [PATCH] Added a script to automatically pull new data and commit it --- auto-pull.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 auto-pull.sh diff --git a/auto-pull.sh b/auto-pull.sh new file mode 100755 index 0000000..980bcd6 --- /dev/null +++ b/auto-pull.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +FILENAME="/home/me/.wine.wow/drive_c/Program Files/World of Warcraft/WTF/Account/IQGRYN/SavedVariables/ItemScanner.lua" + +while inotifywait -e close_write "$FILENAME" +do + if lua get-live-data.lua "$FILENAME" + then + if [ `git diff HEAD | head | wc -l` -gt 0 ] + then + if ! git commit -a -m "Auto-committing scan results: `date`" + then + if ! (git add . && git commit -m "NEW FILES! Auto-committing scan results: `date`") + then + echo "Commit failed, aborting" + for i in `seq 5` + do + echo -n '' + sleep 1 + done + exit 1 + fi + fi + fi + else + echo "Getting data failed, aborting" + for i in `seq 5` + do + echo -n '' + sleep 1 + done + exit 1 + fi +done -- 1.7.9.5