mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-23 14:58:56 +01:00
feat(extract): add support for .crx
(Chrome extension format) (#12652)
This commit is contained in:
parent
ab3d42a34c
commit
e50dd3417c
@ -1,7 +1,54 @@
|
||||
#compdef extract
|
||||
#autoload
|
||||
|
||||
local -a exts=(
|
||||
7z
|
||||
aar
|
||||
apk
|
||||
bz2
|
||||
cab
|
||||
cpio
|
||||
crx
|
||||
deb
|
||||
ear
|
||||
gz
|
||||
ipa
|
||||
ipsw
|
||||
jar
|
||||
lrz
|
||||
lz4
|
||||
lzma
|
||||
obscpio
|
||||
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
|
||||
vsix
|
||||
war
|
||||
whl
|
||||
xpi
|
||||
xz
|
||||
Z
|
||||
zip
|
||||
zpaq
|
||||
zst
|
||||
)
|
||||
|
||||
_arguments \
|
||||
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
|
||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|obscpio|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|zpaq)(-.)'" \
|
||||
"*::archive file:_files -g '(#i)*.(${(j:|:)exts})(-.)'" \
|
||||
&& return 0
|
||||
|
@ -76,7 +76,7 @@ EOF
|
||||
(*.lz4) lz4 -d "$full_path" ;;
|
||||
(*.lzma) unlzma "$full_path" ;;
|
||||
(*.z) uncompress "$full_path" ;;
|
||||
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix) unzip "$full_path" ;;
|
||||
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx) unzip "$full_path" ;;
|
||||
(*.rar) unrar x -ad "$full_path" ;;
|
||||
(*.rpm)
|
||||
rpm2cpio "$full_path" | cpio --quiet -id ;;
|
||||
|
Loading…
Reference in New Issue
Block a user