single html page upload now works tho its akward to use
This commit is contained in:
parent
daf3f5f65e
commit
df79b46e28
@ -11,9 +11,11 @@ _upload_html() {
|
|||||||
echo Path must start with ./
|
echo Path must start with ./
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo $(pwd)
|
||||||
for f in $@;do
|
for f in $@;do
|
||||||
remote_path=${f:1}
|
remote_path=${f:1}
|
||||||
echo curl -H "$auth" -F "$remote_path=@$f" $url/api/upload
|
echo curl -H "$auth" -F "$remote_path=@$f" $url/api/upload
|
||||||
|
curl -H "$auth" -F "$remote_path=@$f" $url/api/upload
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +44,7 @@ Options:
|
|||||||
h => Reuploads all the html content
|
h => Reuploads all the html content
|
||||||
r => Uploads all root html pages
|
r => Uploads all root html pages
|
||||||
f [FOLDER] => Upload all html in [FOLDER]
|
f [FOLDER] => Upload all html in [FOLDER]
|
||||||
|
s [PATH] => Upload single html page with mirrord path
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,12 +52,13 @@ if [ -z $1 ];then
|
|||||||
_help
|
_help
|
||||||
else
|
else
|
||||||
pushd $site > /dev/null
|
pushd $site > /dev/null
|
||||||
while getopts ':Hhrf:' opt;do
|
while getopts ':Hhrf:s:' opt;do
|
||||||
case $opt in
|
case $opt in
|
||||||
H) _help;;
|
H) _help;;
|
||||||
h) _upload_html $(find -name '*.html');; # Upload all html content
|
h) _upload_html $(find -name '*.html');; # Upload all html content
|
||||||
r) _upload_html ./*.html;; # Upload all root html pages
|
r) _upload_html ./*.html;; # Upload all root html pages
|
||||||
f) _upload_html $2/*.html;;# Upload html in the spec'd folder
|
f) _upload_html $2/*.html;;# Upload html in the spec'd folder
|
||||||
|
s) _upload_html $2;;# upload single html page
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user