From f6a075b34f12d0e665234f0c5c5bc796d29b5b5d Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 6 Jul 2022 00:09:47 +0800 Subject: Reformat script --- tools/init/load-settings.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'tools/init/load-settings.sh') diff --git a/tools/init/load-settings.sh b/tools/init/load-settings.sh index 9a01a74..cd5b6bb 100755 --- a/tools/init/load-settings.sh +++ b/tools/init/load-settings.sh @@ -2,23 +2,23 @@ export SETTING_DIR=${SETTING_DIR:=$HOME/helper} export EDITOR=vim export TERM=xterm-256color +trap 'exit.sh' EXIT + # load custom aliases source $SETTING_DIR/alias [[ -d $SETTING_DIR/private ]] && for f in $SETTING_DIR/private/*; do source $f; done -# Config shell - -shell=$(/dev/null || true - -find $SETTING_DIR/tools -type f -executable | \ -xargs realpath | xargs -I{} ln -sf {} $BIN_DIR +find $BIN_DIR -xtype l -exec rm {} + 2>/dev/null +find $SETTING_DIR/tools -type f -executable -exec realpath {} + | \ +xargs -I{} ln -sf {} $BIN_DIR # Mail MAIL=$HOME/Maildir @@ -43,6 +43,7 @@ if which fzf &>/dev/null; then source ~/.fzf.${shell} &>/dev/null fi +# Set zsh or bash if [[ $shell == zsh ]]; then setopt extended_glob fpath=($SETTING_DIR/zsh $fpath) @@ -60,9 +61,7 @@ elif [[ $shell == bash ]]; then bind -m emacs-standard -x '"\ek": fzf_preview' fi -# Run something after exit shell -trap 'exit.sh' EXIT - +# Working DIR [[ `pwd` == $HOME ]] && cd ~/Downloads true -- cgit v1.2.3-70-g09d2