improvement(asdf_install): don't break when a plugin is already installed.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
018acf2769
commit
41568b0149
1 changed files with 15 additions and 2 deletions
17
asdf_install
17
asdf_install
|
@ -3,6 +3,19 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
source ~/.asdf/asdf.sh
|
source ~/.asdf/asdf.sh
|
||||||
cat .tool-versions | cut -d \ -f 1 | xargs -n 1 asdf plugin add
|
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
|
asdf install
|
||||||
cat .tool-versions | xargs -n 2 asdf global
|
echo " ...done"
|
||||||
|
|
Loading…
Reference in a new issue