Skip to content

Commit

Permalink
🐛 resolve load
Browse files Browse the repository at this point in the history
  • Loading branch information
ptavares committed Aug 7, 2021
1 parent 2f71974 commit f71c3ea
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions zsh-tfswitch.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# commons
#####################
autoload colors is-at-least
autoload -U add-zsh-hook

#########################
# constant
Expand Down Expand Up @@ -81,7 +82,8 @@ update_zsh_tfswitch() {

_zsh_tfswitch_load() {
# export PATH
export PATH=${PATH}:${TFSWITCH_HOME}
export CUSTOMBIN=$HOME/.local/bin
export PATH=${PATH}:${TFSWITCH_HOME}:${CUSTOMBIN}
}

# install tfswitch if it isnt already installed
Expand All @@ -98,12 +100,12 @@ fi
########################################################
load-tfswitch() {
local tfswitchrc_path=".tfswitchrc"

if [ -f "$tfswitchrc_path" ]; then
tfswitch
fi
}
add-zsh-hook chpwd load-tfswitch
load-tfswitch

unset -f _zsh_tfswitch_install _zsh_tfswitch_load

add-zsh-hook chpwd load-tfswitch
load-tfswitch

0 comments on commit f71c3ea

Please sign in to comment.