Unverified Commit 1f56f2bd authored by Daniel Wang's avatar Daniel Wang Committed by GitHub

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

parent 0dc40e88
...@@ -30,6 +30,11 @@ EOF ...@@ -30,6 +30,11 @@ EOF
local file="$1" full_path="${1:A}" local file="$1" full_path="${1:A}"
local extract_dir="${1:t:r}" 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 # 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 # add a random string to the end of the extract directory
if [[ -e "$extract_dir" ]]; then if [[ -e "$extract_dir" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment