Update .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_15_install-asdf-packages.tmpl

This commit is contained in:
Brian Zalewski 2022-12-05 07:24:57 +00:00
parent 63cf157a0d
commit 7c5353272f

View file

@ -10,11 +10,14 @@ if [ -f "$ASDF_DIR/asdf.sh" ] && [ -f ~/.tool-versions ]; then
logg info 'Sourcing asdf.sh'
. ${ASDF_DIR}/asdf.sh
cat .tool-versions | while read TOOL; do
logg info 'Installing ASDF plugin `'"$TOOL"'`'
logg info 'Installing ASDF plugin `'"$(echo "$TOOL" | sed 's/ .*//')"'`'
asdf plugin add "$(echo "$TOOL" | sed 's/ .*//')"
done
logg info 'Installing ASDF dependencies derived from `~/.tool-versions` via `asdf install`'
asdf install || true
asdf install || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
logg error 'Error installing the ASDF plugins specified in `~/.tool-versions`'
fi
else
logg warn 'The `$ASDF_DIR/asdf.sh` or `~/.tool-versions` file is not present'
fi