From 7c654e599ecdb5bb79bbb9e400eeaa499081dea3 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Fri, 13 May 2022 09:51:04 +0800 Subject: [PATCH] more robost dotfile_path --- .zshrc2 | 5 ++++- install.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.zshrc2 b/.zshrc2 index 1f4fd0e..d014280 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -58,4 +58,7 @@ antigen bundle https://gitee.com/dictxiong/zsh-autosuggestions antigen theme ys # apply antigen apply -# end of antigen config \ No newline at end of file +# end of antigen config + +# functions +dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) \ No newline at end of file diff --git a/install.sh b/install.sh index 2161283..fe94650 100755 --- a/install.sh +++ b/install.sh @@ -89,7 +89,7 @@ setup_color() { } # END of color settings -dotfile_path=$(cd $(dirname $0); pwd) +dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) home_slashes=${HOME//\//\\\/} if [[ ! $dotfile_path == ${home_slashes}* ]]; then fmt_fatal "\"$dotfile_path\" is not under \"$HOME\". aborting ..."