diff --git a/upload.sh b/upload.sh index 88fd1e8..111c13d 100755 --- a/upload.sh +++ b/upload.sh @@ -11,9 +11,11 @@ _upload_html() { echo Path must start with ./ exit 1 fi + echo $(pwd) for f in $@;do remote_path=${f:1} echo curl -H "$auth" -F "$remote_path=@$f" $url/api/upload + curl -H "$auth" -F "$remote_path=@$f" $url/api/upload done } @@ -42,6 +44,7 @@ Options: h => Reuploads all the html content r => Uploads all root html pages f [FOLDER] => Upload all html in [FOLDER] + s [PATH] => Upload single html page with mirrord path EOF } @@ -49,12 +52,13 @@ if [ -z $1 ];then _help else pushd $site > /dev/null - while getopts ':Hhrf:' opt;do + while getopts ':Hhrf:s:' opt;do case $opt in H) _help;; h) _upload_html $(find -name '*.html');; # Upload all html content r) _upload_html ./*.html;; # Upload all root html pages f) _upload_html $2/*.html;;# Upload html in the spec'd folder + s) _upload_html $2;;# upload single html page esac done popd > /dev/null