Skip to content

Commit

Permalink
Add requested feature asdf-vm#210
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardgalligan authored and Ed Galligan committed Mar 6, 2019
1 parent 9e30218 commit 403bb39
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ list_installed_versions() {

check_if_plugin_exists() {
local plugin_name=$1
local autoinstall_plugin=$2

# Check if we have a non-empty argument
if [ -z "${1}" ]; then
Expand All @@ -81,8 +82,12 @@ check_if_plugin_exists() {
fi

if [ ! -d "$(asdf_data_dir)/plugins/$plugin_name" ]; then
display_error "No such plugin: $plugin_name"
exit 1
if [ "$autoinstall_plugin" == "1" ]; then
plugin_add_command "$plugin_name"
else
display_error "No such plugin: $plugin_name"
exit 1
fi
fi
}

Expand Down

0 comments on commit 403bb39

Please sign in to comment.