diff .chezmoiscripts/run_onchange_after_20-install-asdf-plugins.sh.tmpl @ 687:6aabd0b8d766

feat: install asdf directly without brew
author zegervdv <zegervdv@me.com>
date Sun, 02 Oct 2022 18:43:18 +0200
parents e486254ef420
children 10e3f300baea
line wrap: on
line diff
--- a/.chezmoiscripts/run_onchange_after_20-install-asdf-plugins.sh.tmpl	Sun Oct 02 18:22:00 2022 +0200
+++ b/.chezmoiscripts/run_onchange_after_20-install-asdf-plugins.sh.tmpl	Sun Oct 02 18:43:18 2022 +0200
@@ -3,6 +3,20 @@
 
 # asdf globals tools hash: {{ include "dot_tool-versions" | sha256sum }}
 
+ASDF_INSTALL="$HOME/.asdf"
+ASDF_VERSION="v0.10.2"
+
+if [[ -d "$ASDF_INSTALL" ]]
+then
+  cd "$ASDF_INSTALL"
+  git pull
+  git checkout "$ASDF_VERSION"
+else
+  git clone https://github.com/asdf-vm/asdf.git "$ASDF_INSTALL" --branch="$ASDF_VERSION"
+fi
+
+source ${ASDF_INSTALL}/asdf.sh
+
 asdf_plugin_add() {
   if ! asdf plugin-list | grep -Fq "$1"
   then
@@ -15,6 +29,7 @@
 asdf_plugin_add python
 asdf_plugin_add neovim
 asdf_plugin_add direnv
+asdf_plugin_add rust
 asdf_plugin_add sqlite
 
 asdf install