From 7396d458075d26650dd12c8673c7560abd9ec2ca Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 8 Oct 2015 18:03:27 +0200 Subject: [PATCH] updated dotstow --- dotstow.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dotstow.sh b/dotstow.sh index e5bd897..f2eb79e 100755 --- a/dotstow.sh +++ b/dotstow.sh @@ -2,17 +2,17 @@ if [ -z "$(which realpath)" ]; then realpath() { - path=$1 - if [ "${path[0]}" == "/" ]; then - echo $path; - elif [ "${path[0]}" == "~" ]; then - echo $HOME/${path:2} - elif [ "${path:0:2}" == ".." ]; then - echo $(dirname $(pwd))/${path:3} - elif [ "${path[0]}" == "." ]; then - echo $(pwd)/${path:2} + rpath=$1 + if [ "${rpath[0]}" == "/" ]; then + echo $rpath; + elif [ "${rpath:0:1}" == "~" ]; then + echo $HOME/${rpath:2} + elif [ "${rpath:0:2}" == ".." ]; then + echo $(dirname $(pwd))/${rpath:3} + elif [ "${rpath:0:1}" == "." ]; then + echo $(pwd)/${rpath:2} else - echo $(pwd)/$path + echo $(pwd)/$rpath fi } fi