This commit is contained in:
Dict Xiong 2022-05-14 20:21:20 +08:00 committed by GitHub
parent 53eefc3978
commit b775c932ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

11
.zshrc2
View File

@ -61,15 +61,16 @@ antigen apply
# end of antigen config # end of antigen config
# functions # functions
dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
dfs() dfs()
{ {
if [[$1 == 'update']]; then if [[ $1 == update ]]; then
(cd "$dotfile_path" && env git pull) (cd "$DOTFILES" && env git pull)
else else
echo "unknown command \"$1\". available: update" echo "unknown command \"$1\". available: update"
fi
} }
# alias # alias
alias "pls"="sudo $(fc -ln -1)" alias "pls"='sudo $(fc -ln -1)'
alias "se"="sudo -sE" alias "se"='sudo -sE'

View File

@ -89,7 +89,7 @@ setup_color() {
} }
# END of color settings # END of color settings
dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) dotfile_path=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
home_slashes=${HOME//\//\\\/} home_slashes=${HOME//\//\\\/}
if [[ ! $dotfile_path == ${home_slashes}* ]]; then if [[ ! $dotfile_path == ${home_slashes}* ]]; then
fmt_fatal "\"$dotfile_path\" is not under \"$HOME\". aborting ..." fmt_fatal "\"$dotfile_path\" is not under \"$HOME\". aborting ..."