diff options
-rwxr-xr-x | assets/bin/ass | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/assets/bin/ass b/assets/bin/ass index 27e5c6f3..c82a2565 100755 --- a/assets/bin/ass +++ b/assets/bin/ass @@ -2,25 +2,24 @@ set -euf -# TODO REPO=... -# TODO check if $REPO is the right one -# TODO sanity-check arguments -# TODO commit changes; pull and push $REPO +DB="/krebs/db" +JOURNAL="$DB/truth" +HERE=$(dirname $(readlink -f $0)) -JOURNAL="/krebs/db/truth" +(cd $DB && git pull >/dev/null && echo "pulled new version") -METHOD="$1" -shift +METHOD="$1"; shift case $METHOD in "create") - echo "`date --utc --rfc-3339=ns` create $1" | tee -a $JOURNAL + echo "`date --utc --rfc-3339=ns` create $1" | $HERE/check-truth | tee -a $JOURNAL ;; "set") - echo "`date --utc --rfc-3339=ns` set $1 $2 $3" | tee -a $JOURNAL + echo "`date --utc --rfc-3339=ns` set $1 $2 $3" | $HERE/check-truth | tee -a $JOURNAL ;; *) echo "you are made of stupid!" exit 23 ;; esac +(cd $DB && git commit -a -m bump >/dev/null && git push 1>&2 2>/dev/null && echo "updates pushed")& |