fix(asdf_install): don't crash when no plugins are installed.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
65999fcf08
commit
48704e1951
1 changed files with 2 additions and 3 deletions
|
@ -1,14 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -v
|
||||
|
||||
source ~/.asdf/asdf.sh
|
||||
REQUIRED_PLUGINS=$(cat .tool-versions | cut -d \ -f 1)
|
||||
INSTALLED_PLUGINS=$(asdf plugin list)
|
||||
INSTALLED_PLUGINS=$(asdf plugin list || echo "")
|
||||
|
||||
for PLUGIN in $REQUIRED_PLUGINS; do
|
||||
if [[ $INSTALLED_PLUGINS =~ (^|[^[:alpha:]])$PLUGIN([^[:alpha:]]|$) ]]; then
|
||||
if [[ $INSTALLED_PLUGINS =~ (^|[[:space:]])"$PLUGIN"($|[[:space:]]) ]]; then
|
||||
echo "ASDF plugin $PLUGIN already installed"
|
||||
else
|
||||
echo "Installing $PLUGIN ASDF plugin..."
|
||||
|
|
Loading…
Reference in a new issue