1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-11 00:10:08 +00:00

feat(extract): add support for .ear files (#9901)

Co-authored-by: Corey Hinkle <corey.hinkle@five9.com>
This commit is contained in:
Corey Hinkle 2021-05-28 05:27:16 -04:00 committed by GitHub
parent c95b4a393a
commit 706b2f3765
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -22,6 +22,7 @@ plugins=(... extract)
| `aar` | Android library file | | `aar` | Android library file |
| `bz2` | Bzip2 file | | `bz2` | Bzip2 file |
| `deb` | Debian package | | `deb` | Debian package |
| `ear` | Enterprise Application aRchive |
| `gz` | Gzip file | | `gz` | Gzip file |
| `ipa` | iOS app package | | `ipa` | iOS app package |
| `ipsw` | iOS firmware file | | `ipsw` | iOS firmware file |

View file

@ -3,5 +3,5 @@
_arguments \ _arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0 && return 0

View file

@ -55,7 +55,7 @@ extract() {
(*.lz4) lz4 -d "$1" ;; (*.lz4) lz4 -d "$1" ;;
(*.lzma) unlzma "$1" ;; (*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;; (*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;; (*.rar) unrar x -ad "$1" ;;
(*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;; (*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
(*.7z) 7za x "$1" ;; (*.7z) 7za x "$1" ;;