summaryrefslogtreecommitdiff
path: root/config/.bashrc
diff options
context:
space:
mode:
authorCan Eldem <celdem@gitlab.com>2020-06-08 12:16:35 +0000
committerCan Eldem <celdem@gitlab.com>2020-06-08 12:16:35 +0000
commit5eef2e4c1a5c28f4e2b8e48e4701dae56264a979 (patch)
treef853dc1c8601fb4222908f2ce8d4e03880367db3 /config/.bashrc
parent12ef778891c4bf9fae19ffdc9d566fc7ab309957 (diff)
parent55d3e5288826e21286054ed7cbaaec15e037f1dd (diff)
Merge branch 'asdf-java-version' into 'master'v3.11.2
Load the configured version of Java/Python See merge request gitlab-org/security-products/license-management!163
Diffstat (limited to 'config/.bashrc')
-rw-r--r--config/.bashrc15
1 files changed, 11 insertions, 4 deletions
diff --git a/config/.bashrc b/config/.bashrc
index 9c4dd9a..5ab592a 100644
--- a/config/.bashrc
+++ b/config/.bashrc
@@ -20,16 +20,23 @@ update_java_home() {
fi
}
+function switch_to_exact() {
+ local tool=$1
+ local version=$2
+
+ asdf shell "$tool" "$version"
+ if [[ "$tool" = "java" ]]; then
+ update_java_home
+ 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
+ switch_to_exact "$tool" "$version"
}
function major_version_from() {