From ebc1a1006657bf04d1ed66c93811314b347d6133 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 28 Oct 2013 09:28:23 -0700 Subject: [PATCH] Resolve full path in guacctl. --- bin/guacctl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/guacctl b/bin/guacctl index 7f31f594..729bff8c 100755 --- a/bin/guacctl +++ b/bin/guacctl @@ -9,6 +9,13 @@ # * Setting the destination directory for uploads # +fullpath() { + FILENAME="$1" + DIR=`dirname "$FILENAME"` + FILE=`basename "$FILENAME"` + (cd "$DIR" && echo "$PWD/$FILE") +} + send_download_file() { FILENAME="$1" printf "\033]482200;%s\007" "$FILENAME" @@ -37,7 +44,7 @@ download_files() { for FILENAME in "$@"; do if [ -e "$FILENAME" ]; then - send_download_file $FILENAME + send_download_file `fullpath $FILENAME` else error "$FILENAME: File does not exist." fi @@ -49,7 +56,7 @@ set_directory() { FILENAME="$1" if [ -e "$FILENAME" ]; then - send_set_directory "$FILENAME" + send_set_directory `fullpath "$FILENAME"` else error "$FILENAME: File does not exist or is not a directory." fi