summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-04-14 01:56:17 +0200
committeremkael <emkael@tlen.pl>2017-04-14 01:56:17 +0200
commitda4e3a5b6670e5116c95d7c6db8d7155d66968e6 (patch)
tree8365620dd0eab4a6b48f5d8d68417e9c19e475cc /bin
parent8dda3f31a20df59d6748ba78b8bf2683341bcf07 (diff)
Dates config expanded, standard path included in uniform build scripts
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build.sh20
-rwxr-xr-xbin/make-test.sh9
-rwxr-xr-xbin/make.sh4
3 files changed, 22 insertions, 11 deletions
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