asdf_container/asdf_install
James Harton 48704e1951
All checks were successful
continuous-integration/drone/push Build is passing
fix(asdf_install): don't crash when no plugins are installed.
2023-07-20 11:36:45 +12:00

21 lines
489 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 "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"