asdf_container/asdf_install
James Harton 840ab567c9
All checks were successful
continuous-integration/drone/push Build is passing
improvement: automatically update plugins when installing.
2024-02-15 09:03:38 +13:00

23 lines
536 B
Bash
Executable file

#!/bin/bash
set -e
source ~/.asdf/asdf.sh
REQUIRED_PLUGINS=$(cat .tool-versions | cut -d \ -f 1)
INSTALLED_PLUGINS=$(asdf plugin list || echo "")
for PLUGIN in $REQUIRED_PLUGINS; do
if [[ $INSTALLED_PLUGINS =~ (^|[[:space:]])"$PLUGIN"($|[[:space:]]) ]]; then
echo "Updating $PLUGIN ASDF plugin..."
asdf plugin update $PLUGIN
echo " ...done"
else
echo "Installing $PLUGIN ASDF plugin..."
asdf plugin add $PLUGIN
echo " ...done"
fi
done
echo "Running ASDF install..."
asdf install
echo " ...done"