summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/.bashrc13
-rw-r--r--config/.tool-versions2
2 files changed, 14 insertions, 1 deletions
diff --git a/config/.bashrc b/config/.bashrc
index 288d919..9c463dd 100644
--- a/config/.bashrc
+++ b/config/.bashrc
@@ -11,12 +11,25 @@ function inflate() {
fi
}
+update_java_home() {
+ local java_path
+ java_path="$(asdf which java)"
+ if [[ -n "${java_path}" ]]; then
+ export JAVA_HOME
+ JAVA_HOME="$(dirname "$(dirname "$(realpath "${java_path}")")")"
+ fi
+}
+
function switch_to() {
local tool=$1
local major_version=$2
local version
version="$(grep "$tool" "$HOME/.tool-versions"| tr ' ' '\n' | grep "^$major_version")"
asdf shell "$tool" "$version"
+
+ if [[ "$tool" = "java" ]]; then
+ update_java_home
+ fi
}
function major_version_from() {
diff --git a/config/.tool-versions b/config/.tool-versions
index 92ddb32..9803064 100644
--- a/config/.tool-versions
+++ b/config/.tool-versions
@@ -1,7 +1,7 @@
elixir system
golang system
gradle 6.3
-java adopt-openjdk-8u242-b08 adopt-openjdk-11.0.6+10
+java adopt-openjdk-8u242-b08 adopt-openjdk-11.0.7+10
maven 3.6.3
nodejs 10.19.0
php 7.4.4