From 7d250c4b3d10ff78a68d5361d962b42d7d53284b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 27 Jan 2013 18:16:48 +0000 Subject: 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 --- publish | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3