mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-01 19:49:25 +00:00
archive: fix unrar-free and add support for unar (#1383)
* archive: fix unrar check when using unrar-free unrar-free returns the error code 1 when run without arguments, thus failing the presence check. Replacing the current presence check with (( $+commands[unrar] )) fixes the problem. * archive: add unar support for lsarchive and unarchive No `archive` support with unar.
This commit is contained in:
committed by
Kaleb Elwert
parent
cd703d3c3c
commit
9520f1be6f
@ -57,9 +57,11 @@ while (( $# > 0 )); do
|
||||
(*.lzma) unlzma "$1" ;;
|
||||
(*.Z) uncompress "$1" ;;
|
||||
(*.zip|*.jar) unzip "$1" -d $extract_dir ;;
|
||||
(*.rar) unrar &> /dev/null \
|
||||
&& unrar x -ad "$1" \
|
||||
|| rar x -ad "$1" ;;
|
||||
(*.rar) ( (( $+commands[unrar] )) \
|
||||
&& unrar x -ad "$1" ) \
|
||||
|| ( (( $+commands[rar] )) \
|
||||
&& rar x -ad "$1" ) \
|
||||
|| unar -d "$1" ;;
|
||||
(*.7z) 7za x "$1" ;;
|
||||
(*.deb)
|
||||
mkdir -p "$extract_dir/control"
|
||||
|
Reference in New Issue
Block a user