2022-12-08 20:25:43 -08:00
|
|
|
#!/usr/bin/env bash
|
2023-04-11 20:26:25 -07:00
|
|
|
# @file SDKMAN Install
|
|
|
|
# @brief Ensures SDKMAN is installed.
|
|
|
|
# @description
|
|
|
|
# This script ensures SDKMAN (a Java version manager) is installed using the method recommended on [their
|
|
|
|
# website](https://sdkman.io/).
|
2022-12-08 20:25:43 -08:00
|
|
|
|
2022-12-25 00:30:40 -08:00
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
|
|
{{ includeTemplate "universal/logg" }}
|
2022-12-08 20:25:43 -08:00
|
|
|
|
|
|
|
### Ensure SDKMan is installed (https://sdkman.io/)
|
|
|
|
if [ ! -d "$SDKMAN_DIR" ]; then
|
2023-02-01 18:18:06 -08:00
|
|
|
logg info 'Installing SDKMan via `curl -s "https://get.sdkman.io?rcupdate=false`'
|
2022-12-08 20:25:43 -08:00
|
|
|
logg info "Install directory: $SDKMAN_DIR"
|
2023-02-01 18:18:06 -08:00
|
|
|
curl -s "https://get.sdkman.io?rcupdate=false" | bash
|
2023-06-13 23:40:48 -07:00
|
|
|
logg info 'Running `sdk install java` with bash -c'
|
|
|
|
bash -c 'sdk install java'
|
2022-12-08 20:25:43 -08:00
|
|
|
else
|
|
|
|
logg info 'SDKMan appears to already be installed.'
|
2023-07-07 01:29:58 -07:00
|
|
|
logg info 'Running `sdk update`'
|
|
|
|
sdk update
|
2022-12-08 20:25:43 -08:00
|
|
|
fi
|