From 77b3c895b8dee934278c0022677ffcabc7b22ab8 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 14 Jul 2020 12:29:13 -0700 Subject: [PATCH] basic upload script which can now rebuild all html --- upload.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 upload.sh diff --git a/upload.sh b/upload.sh new file mode 100644 index 0000000..e2db8c4 --- /dev/null +++ b/upload.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source ./.env + +url="https://neocities.org" +auth="Authorization: Bearer $KEY" +site=.mirror + +html() { + # Total reupload of the site's html + pushd $site > /dev/null + echo `pwd` + for f in $(find -name '*.html');do + remote_path=${f:1} + curl -H "$auth" -F "$remote_path=@$f" $url/api/upload + done + popd > /dev/null +} + +if [ -z $1 ];then +cat <