summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-12-19 17:35:22 -0700
committermo khan <mo.khan@gmail.com>2020-01-24 10:58:34 -0700
commitb7db7ebc7525cbb39a96bd7c6600cf6002d802a2 (patch)
treea38830da957a9170c5d8475e2242929fbb93632c /config
parentc694b9fca1c1b90e9d043638ca036fc1bc92c1f1 (diff)
Install LTS versions of tools and move legacy env vars to bashrc
Diffstat (limited to 'config')
-rw-r--r--config/.bashrc25
-rw-r--r--config/.tool-versions10
2 files changed, 30 insertions, 5 deletions
diff --git a/config/.bashrc b/config/.bashrc
index 3844495..ea8c629 100644
--- a/config/.bashrc
+++ b/config/.bashrc
@@ -13,4 +13,29 @@ export RUBY_HEAP_SLOTS_INCREMENT=400000
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
+
+function switch_to() {
+ tool=$1
+ major_version=$2
+ version=$(cat $HOME/.tool-versions | grep $tool | tr ' ' '\n' | grep "^$major_version")
+ asdf shell $tool $version
+}
+
+while IFS= read -r line; do
+ tool=$(echo "$line" | cut -f1)
+ default_version=$(echo "$line" | cut -f2)
+ asdf global "$tool" "$default_version"
+done < "$HOME/.tool-versions"
+
+if [ -n "$LM_PYTHON_VERSION" ]; then
+ MAJOR_VERSION=$(echo "$LM_PYTHON_VERSION" | cut -d'.' -f1)
+ switch_to python "$MAJOR_VERSION"
+ python --version
+ pip --version
+ export LICENSE_FINDER_CLI_OPTS="--python-version $MAJOR_VERSION $LICENSE_FINDER_CLI_OPTS"
+else
+ export LICENSE_FINDER_CLI_OPTS="--python-version 3 $LICENSE_FINDER_CLI_OPTS"
+fi
+
+switch_to java "adopt-openjdk-${LM_JAVA_VERSION:-11}"
. $HOME/.asdf/plugins/java/set-java-home.sh
diff --git a/config/.tool-versions b/config/.tool-versions
index c8f87be..005686b 100644
--- a/config/.tool-versions
+++ b/config/.tool-versions
@@ -1,7 +1,7 @@
golang 1.13.5
-java adopt-openjdk-13.0.1+9 adopt-openjdk-11.0.5+10 adopt-openjdk-8u232-b09
+java adopt-openjdk-11.0.5+10 adopt-openjdk-8u232-b09
maven 3.6.3
-nodejs 12.13.1 13.3.0
-php 7.4.0
-python 2.7.17 3.8.0
-ruby 2.6.5
+nodejs 12.14.0 10.18.0
+php 7.4.1
+python 3.8.1 2.7.17
+ruby 2.6.5 2.5.7 2.4.9