asdf_container/asdf_install

23 lines
485 B
Text
Raw Normal View History

#!/bin/bash
set -e
2023-07-20 08:39:36 +12:00
set -v
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"