From 3bb69a6ba4a8f6ed235556641a5584cb20fa097e Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 6 Feb 2020 18:06:07 +0100 Subject: Automatically generating index.html symlink --- bin/deploy.sh | 2 +- bin/rankings-tables-build.sh | 8 ++------ bin/rankings-tables-generate.sh | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100755 bin/rankings-tables-generate.sh (limited to 'bin') 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 -- cgit v1.2.3