From 47a0d55c93c12b9b9a6cafe2ef8d707450078780 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 21 Feb 2015 14:30:03 -0200 Subject: [PATCH] set path on load fixes #24 --- jvm.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/jvm.sh b/jvm.sh index 77dc873..a58295a 100755 --- a/jvm.sh +++ b/jvm.sh @@ -63,10 +63,16 @@ jvm() { esac } -if [ ! -z "$BASH" ]; then - PROMPT_COMMAND=_jvm-discover-and-set-version -elif [ ! -z "$ZSH_NAME" ]; then - chpwd() { - _jvm-discover-and-set-version - } -fi + +main() { + _jvm-discover-and-set-version + if [ ! -z "$BASH" ]; then + PROMPT_COMMAND=_jvm-discover-and-set-version + elif [ ! -z "$ZSH_NAME" ]; then + chpwd() { + _jvm-discover-and-set-version + } + fi +} + +main