Skip to content

Commit 9668805

Browse files
committed
changed cnfiguration for readability: now sdkman_colour_style can be set to light/dark instead of the numeric valuesi 1/2 (to be precise drk is detected for dimemd colors and anything else defaults to light)
1 parent 7a406c7 commit 9668805

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/main/bash/sdkman-init.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ unset f
8888
if [ -f "${SDKMAN_DIR}/etc/config" ]; then
8989
source "${SDKMAN_DIR}/etc/config"
9090
fi
91+
[[ "$sdkman_colour_style" == "dark" ]] && sdkman_colour_style_code=2 || sdkman_colour_style_code=1
9192

9293
# Create upgrade delay file if it doesn't exist
9394
if [[ ! -f "${SDKMAN_DIR}/var/delay_upgrade" ]]; then

src/main/bash/sdkman-main.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function sdk {
6868
if [ -f "${SDKMAN_DIR}/etc/config" ]; then
6969
source "${SDKMAN_DIR}/etc/config"
7070
fi
71+
[[ "$sdkman_colour_style" == "dark" ]] && sdkman_colour_style_code=2 || sdkman_colour_style_code=1
7172

7273
# no command provided
7374
if [[ -z "$COMMAND" ]]; then

src/main/bash/sdkman-utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function __sdkman_echo {
7272
if [[ "$sdkman_colour_enable" == 'false' ]]; then
7373
echo -e "$2"
7474
else
75-
echo -e "\033[${sdkman_colour_style:-1};$1$2\033[0m"
75+
echo -e "\033[$sdkman_colour_style_code;$1$2\033[0m"
7676
fi
7777
}
7878

@@ -100,6 +100,6 @@ function __sdkman_echo_confirm {
100100
if [[ "$sdkman_colour_enable" == 'false' ]]; then
101101
echo -n "$1"
102102
else
103-
echo -e -n "\033[${sdkman_colour_style:-1};33m$1\033[0m"
103+
echo -e -n "\033[$sdkman_colour_style_code;33m$1\033[0m"
104104
fi
105105
}

0 commit comments

Comments
 (0)