From acd9ce7ffa656fece655862ae55849b84c216c4a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 30 Mar 2016 17:37:27 +0200 Subject: [PATCH] [enh] add a script for crontab --- should_i_rebuild.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 should_i_rebuild.sh diff --git a/should_i_rebuild.sh b/should_i_rebuild.sh new file mode 100644 index 00000000..16fc43bf --- /dev/null +++ b/should_i_rebuild.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -ex + +if [ ! "$1" ] +then + echo "I need a github : to run as first argument" + exit 1 +fi + +before_official=$(sha256sum official.json) +before_community=$(sha256sum community.json) + +git pull + +if [ "$before_official" != "$(sha256sum official.json)" ] +then + python ./list_builder.py -g $1 official.json +fi + +if [ "$before_community" != "$(sha256sum community.json)" ] +then + python ./list_builder.py -g $1 community.json +fi