summaryrefslogtreecommitdiff
path: root/config/.bashrc
diff options
context:
space:
mode:
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() {