1f56f2bdc455f2167c10fdbeca10934f5f0cbd99

Author
Daniel Wang <firedfox@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(extract): remove extraction file extension for tar (#11873)

Diff

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