diff --git a/src/main/bash/sdkman-default.sh b/src/main/bash/sdkman-default.sh index 52d4ec612..a5470c099 100644 --- a/src/main/bash/sdkman-default.sh +++ b/src/main/bash/sdkman-default.sh @@ -17,6 +17,7 @@ # function __sdk_default() { + __sdkman_deprecation_notice "default" local candidate version candidate="$1" diff --git a/src/main/bash/sdkman-help.sh b/src/main/bash/sdkman-help.sh index a8a9b9781..70bacc448 100644 --- a/src/main/bash/sdkman-help.sh +++ b/src/main/bash/sdkman-help.sh @@ -17,6 +17,7 @@ # function __sdk_help() { + __sdkman_deprecation_notice "help" __sdkman_echo_no_colour "" __sdkman_echo_no_colour "Usage: sdk [candidate] [version]" __sdkman_echo_no_colour " sdk offline " diff --git a/src/main/bash/sdkman-home.sh b/src/main/bash/sdkman-home.sh index 841d32bf6..e3e2b4755 100644 --- a/src/main/bash/sdkman-home.sh +++ b/src/main/bash/sdkman-home.sh @@ -17,6 +17,7 @@ # function __sdk_home() { + __sdkman_deprecation_notice "home" local candidate version candidate="$1" diff --git a/src/main/bash/sdkman-uninstall.sh b/src/main/bash/sdkman-uninstall.sh index 16de6cfdd..c43e801b4 100644 --- a/src/main/bash/sdkman-uninstall.sh +++ b/src/main/bash/sdkman-uninstall.sh @@ -17,6 +17,7 @@ # function __sdk_uninstall() { + __sdkman_deprecation_notice "uninstall" local candidate version current candidate="$1" diff --git a/src/main/bash/sdkman-utils.sh b/src/main/bash/sdkman-utils.sh index 51797264f..e6b2247b4 100644 --- a/src/main/bash/sdkman-utils.sh +++ b/src/main/bash/sdkman-utils.sh @@ -110,3 +110,18 @@ function __sdkman_echo_confirm() { echo -e -n "\033[1;33m$1\033[0m" fi } + +function __sdkman_deprecation_notice() { + local message="[Deprecation Notice]: +This legacy '$1' command is replaced by a native implementation +and it will be removed in a future release. +Learn more at https://sdkman.io/native +" + + if [[ "$sdkman_colour_enable" == 'false' ]]; then + __sdkman_echo_no_colour "$message" + else + __sdkman_echo_yellow "$message" + fi +} + diff --git a/src/main/bash/sdkman-version.sh b/src/main/bash/sdkman-version.sh index 0b3b49335..640aa716f 100644 --- a/src/main/bash/sdkman-version.sh +++ b/src/main/bash/sdkman-version.sh @@ -17,6 +17,7 @@ # function __sdk_version() { + __sdkman_deprecation_notice "version" local version=$(cat $SDKMAN_DIR/var/version) echo "" __sdkman_echo_yellow "SDKMAN $version"