Manage your Java environment
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
652 B

#!/usr/bin/env bash
# Summary: Deactivate a jEnv plugin
# Usage: jenv disable-plugin <pluginName>
set -e
[ -n "$JENV_DEBUG" ] && set -x
# Provide jenv completions
if [ "$1" = "--complete" ]; then
exec jenv-plugins --enabled
fi
if [ -z "$1" ]; then
jenv-help disable-plugin >&2
exit 1
fi
plugin="$1"
if [ -h "${JENV_ROOT}/plugins/$plugin" ]; then
if [ -f "${JENV_ROOT}/plugins/$plugin/etc/jenv.d/unload/after.bash" ]; then
source "${JENV_ROOT}/plugins/$plugin/etc/jenv.d/unload/after.bash"
fi
rm -f "${JENV_ROOT}/plugins/$plugin"
$(jenv-rehash)
echo "$plugin disabled"
else
echo "$plugin is not enabled"
fi