1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-06 07:20:40 +01:00

feat(extract): add suport for .cab files via cabextract

This commit is contained in:
Marc Cornellà
2021-08-04 15:49:11 +02:00
parent af6c7f3d67
commit 6dc937ff68
3 changed files with 4 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ extract() {
(*.lz4) lz4 -d "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.ear|*.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" ;;
(*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
(*.7z) 7za x "$1" ;;
@@ -69,6 +69,7 @@ extract() {
cd ..
;;
(*.zst) unzstd "$1" ;;
(*.cab) cabextract -d "$extract_dir" "$1" ;;
(*)
echo "extract: '$1' cannot be extracted" >&2
success=1