more robost dotfile_path

This commit is contained in:
Dict Xiong 2022-05-13 09:51:04 +08:00 committed by GitHub
parent 72b7b60449
commit 7c654e599e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -58,4 +58,7 @@ antigen bundle https://gitee.com/dictxiong/zsh-autosuggestions
antigen theme ys
# apply
antigen apply
# end of antigen config
# end of antigen config
# functions
dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

View File

@ -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 ..."