From b775c932addb99f83c516feeaaff1f66c3fcedfd Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Sat, 14 May 2022 20:21:20 +0800 Subject: [PATCH] debug --- .zshrc2 | 11 ++++++----- install.sh | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.zshrc2 b/.zshrc2 index 5de1c14..1102624 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -61,15 +61,16 @@ antigen apply # end of antigen config # functions -dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd ) dfs() { - if [[$1 == 'update']]; then - (cd "$dotfile_path" && env git pull) + if [[ $1 == update ]]; then + (cd "$DOTFILES" && env git pull) else echo "unknown command \"$1\". available: update" + fi } # alias -alias "pls"="sudo $(fc -ln -1)" -alias "se"="sudo -sE" \ No newline at end of file +alias "pls"='sudo $(fc -ln -1)' +alias "se"='sudo -sE' \ No newline at end of file diff --git a/install.sh b/install.sh index fe94650..0ab7688 100755 --- a/install.sh +++ b/install.sh @@ -89,7 +89,7 @@ setup_color() { } # END of color settings -dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd ) home_slashes=${HOME//\//\\\/} if [[ ! $dotfile_path == ${home_slashes}* ]]; then fmt_fatal "\"$dotfile_path\" is not under \"$HOME\". aborting ..."