Browse Source

jenv doctor detect missconfigured plugin ( #232 )

pull/236/head
Gildas Cuisinier 7 years ago
parent
commit
6ec3376880
  1. 2
      libexec/jenv---version
  2. 18
      libexec/jenv-doctor

2
libexec/jenv---version

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
set -e
[ -n "$JENV_DEBUG" ] && set -x
version="0.5.0"
version="0.5.2"
if [ -d $JENV_ROOT ]; then
cd "$JENV_ROOT"

18
libexec/jenv-doctor

@ -25,6 +25,10 @@ function cfix() { @@ -25,6 +25,10 @@ function cfix() {
echo -e "${COLOR}\t$*${RESET}"
}
resolve_link() {
$(type -p greadlink readlink | head -1) "$1"
}
set -e
[ -n "$JENV_DEBUG" ] && set -x
@ -59,6 +63,7 @@ JAVA_BIN=`command -v java` @@ -59,6 +63,7 @@ JAVA_BIN=`command -v java`
EXPECTED_JAVA="$JENV_ROOT/shims/java"
if [ "$EXPECTED_JAVA" = "$JAVA_BIN" ] ; then
cinfo "Java binaries in path are jenv shims"
else
@ -92,5 +97,18 @@ else @@ -92,5 +97,18 @@ else
cwarn "Jenv is not loaded in your $shell"
cwarn 'To fix : \tcat eval "$(jenv init -)" >>' $profile
fi
for plugin in "${JENV_ROOT}"/plugins/*; do
pluginName=$(basename $plugin)
targetLink=$(resolve_link $plugin)
if [[ ! $targetLink == $JENV_INSTALL_DIR* ]]; then
cwarn "Plugin $pluginName is linked to older jenv installation"
cfix "Please execute : jenv disable-plugin $pluginName && jenv enable-plugin $pluginName"
fi
done

Loading…
Cancel
Save