diff options
author | emkael <emkael@tlen.pl> | 2020-02-06 18:06:07 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2020-02-06 18:12:02 +0100 |
commit | 3bb69a6ba4a8f6ed235556641a5584cb20fa097e (patch) | |
tree | d3d265297d71ea54431f8d604f1fc2c685b8adb9 /bin | |
parent | 0bc3f285e8701989e2727eddbb21d3a1840841f2 (diff) |
Automatically generating index.html symlink
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/deploy.sh | 2 | ||||
-rwxr-xr-x | bin/rankings-tables-build.sh | 8 | ||||
-rwxr-xr-x | bin/rankings-tables-generate.sh | 18 |
3 files changed, 21 insertions, 7 deletions
diff --git a/bin/deploy.sh b/bin/deploy.sh index 4229af4..f121698 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -1,7 +1,7 @@ #!/bin/bash LOCALPATH=$1 DEPLOYPATH=`cat config/deploy-path` -RSYNCOPTS='-urpP --delete --copy-links --exclude=.menu.html' +RSYNCOPTS='-urpP --delete --links --exclude=.menu.html' if [ -s config/deploy-pass ] then sshpass -f config/deploy-pass rsync $RSYNCOPTS $LOCALPATH/ $DEPLOYPATH diff --git a/bin/rankings-tables-build.sh b/bin/rankings-tables-build.sh index d3806a7..6dee62a 100755 --- a/bin/rankings-tables-build.sh +++ b/bin/rankings-tables-build.sh @@ -1,10 +1,6 @@ #!/bin/bash CONFIG=$1 DIR=$2 + cat $CONFIG | - jq '.[] | .date, .url, .index, .menu_age // "old", .name' | - xargs -n5 | - while read DATE URL INDEX AGEMENU NAME - do - python scripts/rankings-tables-compile.py "$NAME" $INDEX $DIR/.menu.html $DATE "$AGEMENU" > $DIR/$URL - done + jq -r '.[] | [.date, .url, .index, .menu_age // "old", .name, .links // []] | flatten | @sh' | xargs -L 1 bin/rankings-tables-generate.sh $DIR diff --git a/bin/rankings-tables-generate.sh b/bin/rankings-tables-generate.sh new file mode 100755 index 0000000..06743c8 --- /dev/null +++ b/bin/rankings-tables-generate.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +DIR=$1 +DATE=$2 +URL=$3 +INDEX=$4 +AGEMENU=$5 +NAME=$6 + +python scripts/rankings-tables-compile.py "$NAME" $INDEX $DIR/.menu.html $DATE "$AGEMENU" > $DIR/$URL + +shift 6 +LINKS=$@ + +echo $LINKS | grep -v "^$" | while read LINK +do + ln -sf $URL $DIR/$LINK +done |