Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
1f56f2bd
Unverified
Commit
1f56f2bd
authored
Sep 03, 2023
by
Daniel Wang
Committed by
GitHub
Sep 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(extract): remove extraction file extension for tar (#11873)
parent
0dc40e88
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
extract.plugin.zsh
plugins/extract/extract.plugin.zsh
+5
-0
No files found.
plugins/extract/extract.plugin.zsh
View file @
1f56f2bd
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment