diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 513950f33..88d8b0740 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -30,6 +30,11 @@ EOF local file="$1" full_path="${1:A}" local extract_dir="${1:t:r}" + # Remove the .tar extension if the file name is .tar.* + if [[ $extract_dir =~ '\.tar$' ]]; then + extract_dir="${extract_dir:r}" + fi + # If there's a file or directory with the same name as the archive # add a random string to the end of the extract directory if [[ -e "$extract_dir" ]]; then