asdf_container/asdf_install
James Harton 41568b0149
Some checks failed
continuous-integration/drone/push Build is failing
improvement(asdf_install): don't break when a plugin is already installed.
2023-07-20 08:37:34 +12:00

21 lines
478 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)
for PLUGIN in $REQUIRED_PLUGINS; do
if [[ $INSTALLED_PLUGINS =~ (^|[^[:alpha:]])$PLUGIN([^[:alpha:]]|$) ]]; then
echo "ASDF plugin $PLUGIN already installed"
else
echo "Installing $PLUGIN ASDF plugin..."
asdf plugin add $PLUGIN
echo " ...done"
fi
done
echo "Running ASDF install..."
asdf install
echo " ...done"