Mercurial > dotfiles
diff .chezmoiscripts/run_once_after_20-install-asdf-plugins.sh.tmpl @ 808:459e70c99f4c
ci: add test image
author | zegervdv <zegervdv@me.com> |
---|---|
date | Sun, 03 Dec 2023 22:24:26 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.chezmoiscripts/run_once_after_20-install-asdf-plugins.sh.tmpl Sun Dec 03 22:24:26 2023 +0100 @@ -0,0 +1,40 @@ +{{ if (or (eq .chezmoi.os "darwin") (and (eq .chezmoi.os "linux") (ne .chezmoi.arch "arm64") (ne .chezmoi.osRelease.id "centos"))) -}} +#!/usr/bin/env bash + +# 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 + asdf plugin-add "$1" + else + echo "asdf plugin $1 already installed" + fi +} + +asdf_plugin_add python +asdf_plugin_add neovim +asdf_plugin_add direnv +asdf_plugin_add rust +asdf_plugin_add sqlite + +asdf install +asdf direnv setup --shell zsh --version latest + +asdf reshim + +{{ end -}}