2023-07-19 16:04:00 +12:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
source ~/.asdf/asdf.sh
|
2023-07-20 08:37:34 +12:00
|
|
|
REQUIRED_PLUGINS=$(cat .tool-versions | cut -d \ -f 1)
|
2023-07-20 10:46:46 +12:00
|
|
|
INSTALLED_PLUGINS=$(asdf plugin list || echo "")
|
2023-07-20 08:37:34 +12:00
|
|
|
|
|
|
|
for PLUGIN in $REQUIRED_PLUGINS; do
|
2023-07-20 10:46:46 +12:00
|
|
|
if [[ $INSTALLED_PLUGINS =~ (^|[[:space:]])"$PLUGIN"($|[[:space:]]) ]]; then
|
2023-07-20 08:37:34 +12:00
|
|
|
echo "ASDF plugin $PLUGIN already installed"
|
|
|
|
else
|
|
|
|
echo "Installing $PLUGIN ASDF plugin..."
|
|
|
|
asdf plugin add $PLUGIN
|
|
|
|
echo " ...done"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Running ASDF install..."
|
2023-07-19 16:04:00 +12:00
|
|
|
asdf install
|
2023-07-20 08:37:34 +12:00
|
|
|
echo " ...done"
|