summaryrefslogtreecommitdiff
path: root/publish
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2013-01-27 18:16:48 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2013-01-27 18:16:48 +0000
commit7d250c4b3d10ff78a68d5361d962b42d7d53284b (patch)
treeebbdcc511d2f48d78bb2af976e916be6ea3dc7ff /publish
parente54fa22fe506ba1337773da83e15121f10491233 (diff)
Fix output when we publish a single directory.
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@578 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'publish')
-rwxr-xr-xpublish8
1 files changed, 7 insertions, 1 deletions
diff --git a/publish b/publish
index 62190e2..460e0d2 100755
--- a/publish
+++ b/publish
@@ -222,9 +222,11 @@ base_uri="$base_http/$d_server_http_base/"
main_uri="$base_uri"
trail=""
+one_dir_only=""
if [ "$#" = 1 ]; then
if [ -d "$1" ]; then
trail="/"
+ one_dir_only=1
else
main_uri="$base_uri$( echo -n "$(basename "$1")" | uri_encode )"
fi
@@ -275,7 +277,11 @@ while [ "$#" -gt 0 ]; do
shift
if [ -z "$relative" ]; then
- uri="$base_uri""$( echo -n "`basename "$file"`" | uri_encode )"
+ if [ -z "$one_dir_only" ]; then
+ uri="$base_uri""$( echo -n "`basename "$file"`" | uri_encode )"
+ else
+ uri="$base_uri"
+ fi
else
uri="$base_uri""$( echo -n $file | uri_encode )"
fi