diff --git a/lib/functions/installs.bash b/lib/functions/installs.bash index 036c1dab9..78e52f74f 100644 --- a/lib/functions/installs.bash +++ b/lib/functions/installs.bash @@ -235,9 +235,9 @@ install_tool_version() { local install_exit_code=$? 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" ]; then - if [ -d "$download_path" ]; then + if [ -d "$download_path" ]; then + always_keep_download=$(get_asdf_config_value "always_keep_download") + if [ "$keep_download" != "true" ] && [ "$always_keep_download" != "yes" ]; then rm -r "$download_path" else printf '%s\n' "asdf: Warn: You have configured asdf to preserve downloaded files (with always_keep_download=yes or --keep-download). But" >&2