Skip to content

Instantly share code, notes, and snippets.

@helpermethod
Last active March 3, 2020 00:45
Show Gist options
  • Save helpermethod/7be2867bea73a11e642e3a4bcb73e273 to your computer and use it in GitHub Desktop.
Save helpermethod/7be2867bea73a11e642e3a4bcb73e273 to your computer and use it in GitHub Desktop.
.sdkrc support for sdkman
#!/usr/bin/env bash
__sdk_local() {
[[ ! -f .sdkrc ]] || return
local line
while IFS= read -r line; do
local candidate=${line%=*}
local version=${line#*=}
[[ ! -d "$SDKMAN_CANDIDATES_DIR/$candidate/$version" ]] && sdk install "$candidate" "$version"
sdk use "$candidate" "$version"
done < .sdkrc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment