From 83cbe655c76ddd606a2b24a9a03cba8fb7c117ab Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Sun, 18 Aug 2019 01:54:44 -0700 Subject: [PATCH] commiting for reference new feature actually busted --- make.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/make.sh b/make.sh index 70b8619..fb509a3 100755 --- a/make.sh +++ b/make.sh @@ -1,6 +1,8 @@ #!/bin/bash rootDir='./site/' targetDir='post/' +source .creds +url="https://$user:$pass@neocities.org/api/upload" post() { tmp=".swap" @@ -22,6 +24,13 @@ post() { rm -f $full } +upload() { + cd $rootDir + name='' + # first the root pages + find -type f | xargs 'name=basename %';curl -f "$name=@%" $url +} + _help() { echo 'Options: -p [postDirectory/*] @@ -30,7 +39,7 @@ _help() { } mkdir -p "$rootDir/post" -while getopts ":srhp:" opt;do +while getopts ":srhup:" opt;do case "$opt" in s) cp style.css "$rootDir" # root stylesheet @@ -51,6 +60,8 @@ while getopts ":srhp:" opt;do post $file done ;; + u) + upload;; h) _help;; esac