summaryrefslogtreecommitdiff
path: root/publish
diff options
context:
space:
mode:
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