1
0
chezmoi/home/.chezmoiscripts/run_once_after_20-install-asdf-plugins.sh.tmpl

42 lines
988 B
Cheetah
Raw Normal View History

2024-05-07 21:17:46 +00:00
#!{{ lookPath "bash" }}
2024-03-01 13:25:34 +00:00
2024-08-03 15:21:54 +00:00
# include lib
. ${CHEZMOI_WORKING_TREE}/scripts/utils.sh
. ${HOME}/.asdf/asdf.sh
2024-03-01 13:25:34 +00:00
# Plugins to install
declare -A plugins
plugins=(
2024-05-14 16:52:38 +00:00
['direnv']=''
2024-03-01 13:25:34 +00:00
['golang']='https://github.com/asdf-community/asdf-golang.git'
2024-03-01 16:39:47 +00:00
['nodejs']='https://github.com/asdf-vm/asdf-nodejs.git'
['opam']='https://github.com/asdf-community/asdf-opam.git'
2024-03-01 16:39:47 +00:00
['ruby']='https://github.com/asdf-vm/asdf-ruby.git'
2024-03-03 14:09:10 +00:00
['rust']='https://github.com/code-lever/asdf-rust.git'
2024-03-03 14:51:37 +00:00
['starship']=''
2024-03-01 13:25:34 +00:00
)
### Install ASDF plugins ###
log "Begin ASDF plugins installation"
2024-03-01 14:14:47 +00:00
inf "installing direnv with system version..."
# no need to run asdf direnv setup --shell zsh --version latest
# as it is managed by zim module
asdf plugin-add direnv
2024-03-01 13:25:34 +00:00
for plugin in ${!plugins[@]}; do
inf "installing ${plugin}..."
asdf plugin add ${plugin} ${plugins[$plugin]}
2024-03-01 14:44:49 +00:00
asdf install ${plugin} latest
2024-03-01 14:14:47 +00:00
asdf global ${plugin} latest
2024-03-01 13:25:34 +00:00
done
2024-03-06 17:55:11 +00:00
inf "initializing opam..."
opam init
2024-03-01 13:25:34 +00:00
log "Finish ASDF plugins installation"