Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
68c4c062
Commit
68c4c062
authored
Nov 19, 2019
by
Richard Pöttler
Committed by
Marc Cornellà
Nov 19, 2019
Browse files
extract: add RPM archive support (#8347)
Also more quiet extraction. -D for cpio was not used due to additional output.
parent
26df8a22
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/extract/README.md
View file @
68c4c062
...
...
@@ -27,6 +27,7 @@ plugins=(... extract)
|
`jar`
| Java Archive |
|
`lzma`
| LZMA archive |
|
`rar`
| WinRAR archive |
|
`rpm`
| RPM package |
|
`sublime-package`
| Sublime Text package |
|
`tar`
| Tarball |
|
`tar.bz2`
| Tarball with bzip2 compression |
...
...
plugins/extract/_extract
View file @
68c4c062
...
...
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|
rpm|
sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \
&& return 0
plugins/extract/extract.plugin.zsh
View file @
68c4c062
...
...
@@ -48,6 +48,7 @@ extract() {
(
*
.z
)
uncompress
"
$1
"
;;
(
*
.zip|
*
.war|
*
.jar|
*
.sublime-package|
*
.ipsw|
*
.xpi|
*
.apk|
*
.aar|
*
.whl
)
unzip
"
$1
"
-d
$extract_dir
;;
(
*
.rar
)
unrar x
-ad
"
$1
"
;;
(
*
.rpm
)
mkdir
"
$extract_dir
"
&&
cd
"
$extract_dir
"
&&
rpm2cpio
"../
$1
"
| cpio
--quiet
-id
&&
cd
..
;;
(
*
.7z
)
7za x
"
$1
"
;;
(
*
.deb
)
mkdir
-p
"
$extract_dir
/control"
...
...
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