diff options
| author | Hsieh Chin Fan <typebrook@gmail.com> | 2020-09-08 10:44:05 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <typebrook@gmail.com> | 2020-09-08 10:44:05 +0800 |
| commit | 4944344d5add3d8b8265deef39dd368d44873c1b (patch) | |
| tree | 4b10a14f89944f6ea8aa7fc073ac035bc6dc23d7 | |
| parent | 7db0adfa7996d5fe305383c76db75fc0ba76e4b0 (diff) | |
update
| -rwxr-xr-x | tools/load-settings.sh | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/load-settings.sh b/tools/load-settings.sh index f33e6b3..66ec879 100755 --- a/tools/load-settings.sh +++ b/tools/load-settings.sh | |||
| @@ -1,7 +1,3 @@ | |||
| 1 | if [[ -z "$SETTING_DIR" ]]; then | ||
| 2 | SETTING_DIR=$HOME/settings | ||
| 3 | fi | ||
| 4 | |||
| 5 | if [[ $0 == 'zsh' ]]; then | 1 | if [[ $0 == 'zsh' ]]; then |
| 6 | setopt extended_glob | 2 | setopt extended_glob |
| 7 | elif [[ $0 == 'bash' ]]; then | 3 | elif [[ $0 == 'bash' ]]; then |
| @@ -12,16 +8,14 @@ fi | |||
| 12 | export EDITOR=vim | 8 | export EDITOR=vim |
| 13 | 9 | ||
| 14 | # load custom aliases | 10 | # load custom aliases |
| 11 | SETTING_DIR=${SETTING_DIR:=$HOME/settings} | ||
| 15 | source $SETTING_DIR/alias | 12 | source $SETTING_DIR/alias |
| 16 | 13 | ||
| 17 | # sync with important git repos | ||
| 18 | $SETTING_DIR/tools/sync.sh | ||
| 19 | |||
| 20 | # Add custom scripts into PATH | 14 | # Add custom scripts into PATH |
| 21 | BIN_DIR=$HOME/bin | 15 | BIN_DIR=$HOME/bin |
| 22 | PATH=$PATH:$BIN_DIR | 16 | PATH=$PATH:$BIN_DIR |
| 23 | mkdir -p $BIN_DIR | 17 | mkdir -p $BIN_DIR |
| 24 | find $BIN_DIR -xtype l | xargs rm | 18 | find $BIN_DIR -xtype l | xargs rm 2>/dev/null || true |
| 25 | 19 | ||
| 26 | find $SETTING_DIR/tools -type f -executable | \ | 20 | find $SETTING_DIR/tools -type f -executable | \ |
| 27 | xargs realpath | xargs -I{} ln -sf {} $BIN_DIR | 21 | xargs realpath | xargs -I{} ln -sf {} $BIN_DIR |
| @@ -30,5 +24,8 @@ xargs realpath | xargs -I{} ln -sf {} $BIN_DIR | |||
| 30 | OSM_UTIL_DIR=$SETTING_DIR/tools/osm | 24 | OSM_UTIL_DIR=$SETTING_DIR/tools/osm |
| 31 | source $OSM_UTIL_DIR/osm | 25 | source $OSM_UTIL_DIR/osm |
| 32 | 26 | ||
| 27 | # sync with important git repos | ||
| 28 | $SETTING_DIR/tools/sync.sh | ||
| 29 | |||
| 33 | # go | 30 | # go |
| 34 | PATH=$PATH:$HOME/go/bin | 31 | PATH=$PATH:$HOME/go/bin |