diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2022-10-04 10:56:12 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2022-10-04 10:56:12 +0800 |
commit | 09fdd02e5dfca71e941695a6e95b9c9c636922ae (patch) | |
tree | da5331fd0ec8d496b1056b95be0c8ea3949d4f99 | |
parent | 7e206fd76bf948672d4ae2d8d646f893bcbc11dc (diff) |
Fix logic error about checking shell
-rw-r--r-- | alias | 2 | ||||
-rwxr-xr-x | tools/init/load-settings.sh | 10 |
2 files changed, 6 insertions, 6 deletions
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | # config | 3 | # config |
4 | alias al="vim $SETTING_DIR/alias && source $SETTING_DIR/alias" | 4 | alias al="vim $SETTING_DIR/alias && source $SETTING_DIR/alias" |
5 | alias $(basename $SHELL)rc="vim ~/.$(basename $SHELL)rc && source ~/.$(basename $SHELL)rc" | 5 | alias ${shell}rc="vim ~/.${shell}rc && source ~/.${shell}rc" |
6 | alias vimrc='vim ~/.vimrc' | 6 | alias vimrc='vim ~/.vimrc' |
7 | alias tigrc="vim ~/.tigrc" | 7 | alias tigrc="vim ~/.tigrc" |
8 | alias muttrc='vim ~/.config/mutt/muttrc' | 8 | alias muttrc='vim ~/.config/mutt/muttrc' |
diff --git a/tools/init/load-settings.sh b/tools/init/load-settings.sh index 4529751..83c3d58 100755 --- a/tools/init/load-settings.sh +++ b/tools/init/load-settings.sh | |||
@@ -1,18 +1,18 @@ | |||
1 | trap 'exit.sh' EXIT | ||
2 | |||
1 | export SETTING_DIR=${SETTING_DIR:=$HOME/helper} | 3 | export SETTING_DIR=${SETTING_DIR:=$HOME/helper} |
2 | export EDITOR=vim | 4 | export EDITOR=vim |
3 | export TERM=xterm-256color | 5 | export TERM=xterm-256color |
4 | export XDG_CONFIG_HOME=~/.config | 6 | export XDG_CONFIG_HOME=~/.config |
5 | 7 | ||
6 | trap 'exit.sh' EXIT | 8 | # Get current shell |
9 | export shell=$(</proc/$$/cmdline tr -d '[\0\-]') | ||
10 | shell=${shell##*/} | ||
7 | 11 | ||
8 | # load custom aliases | 12 | # load custom aliases |
9 | source $SETTING_DIR/alias | 13 | source $SETTING_DIR/alias |
10 | [[ -d $SETTING_DIR/private ]] && for f in $SETTING_DIR/private/*; do source $f; done | 14 | [[ -d $SETTING_DIR/private ]] && for f in $SETTING_DIR/private/*; do source $f; done |
11 | 15 | ||
12 | # Get current shell | ||
13 | shell=$(</proc/$$/cmdline tr -d '[\0\-]') | ||
14 | shell=${shell##*/} | ||
15 | |||
16 | # Add custom scripts into PATH | 16 | # Add custom scripts into PATH |
17 | BIN_DIR=$HOME/bin | 17 | BIN_DIR=$HOME/bin |
18 | PATH=$BIN_DIR:$PATH | 18 | PATH=$BIN_DIR:$PATH |