From da4e3a5b6670e5116c95d7c6db8d7155d66968e6 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 14 Apr 2017 01:56:17 +0200 Subject: Dates config expanded, standard path included in uniform build scripts --- bin/build.sh | 20 ++++++++++++++++++++ bin/make-test.sh | 9 +-------- bin/make.sh | 4 +--- 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100755 bin/build.sh (limited to 'bin') diff --git a/bin/build.sh b/bin/build.sh new file mode 100755 index 0000000..4cd0f90 --- /dev/null +++ b/bin/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash +CONFIG=$1 +DIR=$2 +rm config/dates.json +ln -s $CONFIG config/dates.json +PREV_DATE="" +cat config/dates.json | + jq '.[] | .date, .url, .index, .name' | + xargs -n4 | + while read DATE URL INDEX NAME + do + python ranking.py $DATE $PREV_DATE > $DIR/$URL + PREV_DATE=$DATE + done +find $DIR -maxdepth 1 -type f -name \*.html | + while read FILE + do + python editions.py $FILE + done +python players.py $DIR/players diff --git a/bin/make-test.sh b/bin/make-test.sh index e93634f..49961ec 100755 --- a/bin/make-test.sh +++ b/bin/make-test.sh @@ -1,9 +1,2 @@ #!/bin/bash -python ranking.py 2016-12-31 > http/test/2017-01.html -python ranking.py 2017-04-30 2016-12-31 > http/test/index.html -find http/test -maxdepth 1 -type f -name \*.html | - while read FILE - do - python editions.py config/test-dates.json $FILE - done -python players.py http/test/players config/test-dates.json +bin/build.sh test-dates.json http/test diff --git a/bin/make.sh b/bin/make.sh index ed8ff4a..55f5e77 100755 --- a/bin/make.sh +++ b/bin/make.sh @@ -1,4 +1,2 @@ #!/bin/bash -python ranking.py 2016-12-31 > http/index.html -python editions.py config/dates.json http/index.html -python players.py http/players config/dates.json +bin/build.sh prod-dates.json http -- cgit v1.2.3