commiting for reference new feature actually busted
This commit is contained in:
parent
035ae98ff8
commit
83cbe655c7
13
make.sh
13
make.sh
@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
rootDir='./site/'
|
rootDir='./site/'
|
||||||
targetDir='post/'
|
targetDir='post/'
|
||||||
|
source .creds
|
||||||
|
url="https://$user:$pass@neocities.org/api/upload"
|
||||||
|
|
||||||
post() {
|
post() {
|
||||||
tmp=".swap"
|
tmp=".swap"
|
||||||
@ -22,6 +24,13 @@ post() {
|
|||||||
rm -f $full
|
rm -f $full
|
||||||
}
|
}
|
||||||
|
|
||||||
|
upload() {
|
||||||
|
cd $rootDir
|
||||||
|
name=''
|
||||||
|
# first the root pages
|
||||||
|
find -type f | xargs 'name=basename %';curl -f "$name=@%" $url
|
||||||
|
}
|
||||||
|
|
||||||
_help() {
|
_help() {
|
||||||
echo 'Options:
|
echo 'Options:
|
||||||
-p [postDirectory/*]
|
-p [postDirectory/*]
|
||||||
@ -30,7 +39,7 @@ _help() {
|
|||||||
}
|
}
|
||||||
mkdir -p "$rootDir/post"
|
mkdir -p "$rootDir/post"
|
||||||
|
|
||||||
while getopts ":srhp:" opt;do
|
while getopts ":srhup:" opt;do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
s)
|
s)
|
||||||
cp style.css "$rootDir" # root stylesheet
|
cp style.css "$rootDir" # root stylesheet
|
||||||
@ -51,6 +60,8 @@ while getopts ":srhp:" opt;do
|
|||||||
post $file
|
post $file
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
u)
|
||||||
|
upload;;
|
||||||
h)
|
h)
|
||||||
_help;;
|
_help;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user