aboutsummaryrefslogtreecommitdiff
path: root/src/java/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/install.sh')
-rw-r--r--src/java/install.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/java/install.sh b/src/java/install.sh
index f5880cd..7918568 100644
--- a/src/java/install.sh
+++ b/src/java/install.sh
@@ -9,10 +9,11 @@
#
# Syntax: ./java-debian.sh [JDK version] [SDKMAN_DIR] [non-root user] [Add to rc files flag]
-JAVA_VERSION=${1:-"lts"}
-export SDKMAN_DIR=${2:-"/usr/local/sdkman"}
-USERNAME=${3:-"automatic"}
-UPDATE_RC=${4:-"true"}
+JAVA_VERSION=${VERSION:-"lts"}
+
+export SDKMAN_DIR=${SDKMAN_DIR:-"/usr/local/sdkman"}
+USERNAME=${USERNAME:-"automatic"}
+UPDATE_RC=${UPDATE_RC:-"true"}
set -e
@@ -30,7 +31,7 @@ chmod +x /etc/profile.d/00-restore-env.sh
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
- for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
+ for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break