Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add silent mode option #1179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/jreleaser/distributions/sdkman-cli/brew/formula.rb.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class {{brewFormulaName}} < Formula
sdkman_insecure_ssl=false
sdkman_rosetta2_compatible=false
sdkman_selfupdate_feature=false
sdkman_silent_mode=false
EOS
end

Expand Down
3 changes: 2 additions & 1 deletion src/main/bash/sdkman-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ function __sdkman_env_restore_default_version() {
candidate_dir="${SDKMAN_CANDIDATES_DIR}/${candidate}/current"
if __sdkman_is_symlink $candidate_dir; then
default_version=$(basename $(readlink ${candidate_dir}))
__sdk_use "$candidate" "$default_version" >/dev/null &&
if __sdk_use "$candidate" "$default_version" >/dev/null && [[ "${sdkman_silent_mode}" == 'false' ]]; then
__sdkman_echo_yellow "Restored $candidate version to $default_version (default)"
fi
else
__sdkman_echo_yellow "No default version of $candidate was found"
fi
Expand Down
6 changes: 4 additions & 2 deletions src/main/bash/sdkman-use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ function __sdk_use() {
__sdkman_link_candidate_version "$candidate" "$version"
fi

echo ""
__sdkman_echo_green "Using ${candidate} version ${version} in this shell."
if [[ "$sdkman_silent_mode" == 'false' ]]; then
echo ""
__sdkman_echo_green "Using ${candidate} version ${version} in this shell."
fi
}