From 6fcb6b0750b4f9c97f1c929a5565afbee77672de Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sat, 10 Nov 2018 16:51:47 +0200 Subject: [PATCH] automatically get DOTFILES_PATH --- install.sh | 3 +-- zlogin | 6 +++--- zshenv | 14 ++++++-------- zshrc | 16 ++++++++-------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/install.sh b/install.sh index 9535d1b..97c1a9e 100755 --- a/install.sh +++ b/install.sh @@ -12,7 +12,6 @@ for zsh_file_name in z{shenv,shrc,login}; do cat > "$zsh_file" <&2 -fi +DOTFILES_PATH="${0:h}" + +for script in functions path exports; do + source "$DOTFILES_PATH/lib/$script.zsh" + source_if_exists "$DOTFILES_PATH/custom/$script.zsh" +done diff --git a/zshrc b/zshrc index 4ee333a..745964a 100755 --- a/zshrc +++ b/zshrc @@ -1,11 +1,11 @@ #!/usr/bin/env zsh -if [[ -n "$DOTFILES_PATH" ]]; then - for script in oh-my-zsh aliases widgets theme; do - source "$DOTFILES_PATH/lib/$script.zsh" - source_if_exists "$DOTFILES_PATH/custom/$script.zsh" - done +DOTFILES_PATH="${0:h}" - run_before rbenv 'eval "$(rbenv init -)"' - run_before sdk 'source_if_exists "$SDKMAN_DIR/bin/sdkman-init.sh"' -fi +for script in oh-my-zsh aliases widgets theme; do + source "$DOTFILES_PATH/lib/$script.zsh" + source_if_exists "$DOTFILES_PATH/custom/$script.zsh" +done + +run_before rbenv 'eval "$(rbenv init -)"' +run_before sdk 'source_if_exists "$SDKMAN_DIR/bin/sdkman-init.sh"'