File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,11 +303,16 @@ if [ ! -d "${SDKMAN_DIR}" ]; then
303303 export SDKMAN_NATIVE_VERSION=" false"
304304 fi
305305 curl -sSL " https://get.sdkman.io?rcupdate=false" | bash
306- # For RHEL 8 systems, also disable native version in config file and remove native binaries
306+ # For RHEL 8 systems, also disable native CLI in config file and remove native binaries
307307 if [ " ${ADJUSTED_ID} " = " rhel" ] && [ " ${MAJOR_VERSION_ID} " = " 8" ]; then
308- # Disable native version in config to prevent future usage
308+ # Disable native CLI in config to prevent future usage
309+ # The SDKMAN config key is sdkman_native_enable (checked in sdkman-main.sh)
309310 if [ -f " ${SDKMAN_DIR} /etc/config" ]; then
310- sed -i ' s/sdkman_native_version=.*/sdkman_native_version=false/' " ${SDKMAN_DIR} /etc/config"
311+ if grep -q " sdkman_native_enable" " ${SDKMAN_DIR} /etc/config" ; then
312+ sed -i ' s/sdkman_native_enable=.*/sdkman_native_enable=false/' " ${SDKMAN_DIR} /etc/config"
313+ else
314+ echo " sdkman_native_enable=false" >> " ${SDKMAN_DIR} /etc/config"
315+ fi
311316 fi
312317 # Remove native binaries if they were installed
313318 if [ -d " ${SDKMAN_DIR} /libexec" ]; then
You can’t perform that action at this time.
0 commit comments