Skip to content

Commit

Permalink
changed configuration for readability: now sdkman_colour_style can be…
Browse files Browse the repository at this point in the history
… set to light/dark instead of the numeric values 1/2 (to be precise dark is detected for dimmed colors and anything else defaults to light)
  • Loading branch information
fditolla committed Aug 30, 2017
1 parent 7a406c7 commit cb2816a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/bash/sdkman-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ unset f
if [ -f "${SDKMAN_DIR}/etc/config" ]; then
source "${SDKMAN_DIR}/etc/config"
fi
[[ "$sdkman_colour_style" == "dark" ]] && sdkman_colour_style_code=2 || sdkman_colour_style_code=1

# Create upgrade delay file if it doesn't exist
if [[ ! -f "${SDKMAN_DIR}/var/delay_upgrade" ]]; then
Expand Down
1 change: 1 addition & 0 deletions src/main/bash/sdkman-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function sdk {
if [ -f "${SDKMAN_DIR}/etc/config" ]; then
source "${SDKMAN_DIR}/etc/config"
fi
[[ "$sdkman_colour_style" == "dark" ]] && sdkman_colour_style_code=2 || sdkman_colour_style_code=1

# no command provided
if [[ -z "$COMMAND" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions src/main/bash/sdkman-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function __sdkman_echo {
if [[ "$sdkman_colour_enable" == 'false' ]]; then
echo -e "$2"
else
echo -e "\033[${sdkman_colour_style:-1};$1$2\033[0m"
echo -e "\033[$sdkman_colour_style_code;$1$2\033[0m"
fi
}

Expand Down Expand Up @@ -100,6 +100,6 @@ function __sdkman_echo_confirm {
if [[ "$sdkman_colour_enable" == 'false' ]]; then
echo -n "$1"
else
echo -e -n "\033[${sdkman_colour_style:-1};33m$1\033[0m"
echo -e -n "\033[$sdkman_colour_style_code;33m$1\033[0m"
fi
}

0 comments on commit cb2816a

Please sign in to comment.