mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-02 06:19: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
@ -43,9 +43,11 @@ while (( $# > 0 )); do
|
||||
|| lzcat "$1" | tar x${verbose:+v}f - ;;
|
||||
(*.tar) tar t${verbose:+v}f "$1" ;;
|
||||
(*.zip|*.jar) unzip -l${verbose:+v} "$1" ;;
|
||||
(*.rar) unrar &> /dev/null \
|
||||
&& unrar ${${verbose:+v}:-l} "$1" \
|
||||
|| rar ${${verbose:+v}:-l} "$1" ;;
|
||||
(*.rar) ( (( $+commands[unrar] )) \
|
||||
&& unrar ${${verbose:+v}:-l} "$1" ) \
|
||||
|| ( (( $+commands[rar] )) \
|
||||
&& rar ${${verbose:+v}:-l} "$1" ) \
|
||||
|| lsar ${verbose:+-l} "$1" ;;
|
||||
(*.7z) 7za l "$1" ;;
|
||||
(*)
|
||||
print "$0: cannot list: $1" >&2
|
||||
|
Reference in New Issue
Block a user