diff --git a/lib/functions/installs.bash b/lib/functions/installs.bash index 721ae50c4..385c18ef6 100644 --- a/lib/functions/installs.bash +++ b/lib/functions/installs.bash @@ -236,8 +236,12 @@ install_tool_version() { if [ $install_exit_code -eq 0 ] && [ $download_exit_code -eq 0 ]; then # Remove download directory if --keep-download flag or always_keep_download config setting are not set always_keep_download=$(get_asdf_config_value "always_keep_download") - if [ ! "$keep_download" = "true" ] && [ ! "$always_keep_download" = "yes" ] && [ -d "$download_path" ]; then - rm -r "$download_path" + if [ ! "$keep_download" = "true" ] && [ ! "$always_keep_download" = "yes" ]; then + if [ -d "$download_path" ]; then + rm -r "$download_path" + else + printf '%s\n' "You have set always_keep_download=yes or passed '--keep-download', but the current plugin does not support that." + fi fi reshim_command "$plugin_name" "$full_version"