diff options
author | jakanakae-envangel <jakanakaevangeli@chiru.no> | 2018-08-28 15:53:11 +0200 |
---|---|---|
committer | jakanakae-envangel <jakanakaevangeli@chiru.no> | 2018-08-28 15:53:11 +0200 |
commit | d062ce4b0b4a8ca75c5bb7d27a35dc0471718d2c (patch) | |
tree | e1e24e5b03b1a6ecb07b5ac1a4856c8222b0ceff | |
parent | 1e8dbdea782bf4928f8df7ff1768b1fa646a3a5c (diff) | |
download | ranger-d062ce4b0b4a8ca75c5bb7d27a35dc0471718d2c.tar.gz |
scope.sh: Simplify exit status checking
-rwxr-xr-x | ranger/data/scope.sh | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index c0847551..b516904f 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -129,24 +129,17 @@ handle_image() { # application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar) # local fn="" # local bsd="" - # local zip=""; local rar=""; local z7=""; local tar="" - # case "${MIMETYPE}" in + # local zip=""; local rar=""; local tar="" + # case "${mimetype}" in # application/zip) zip=1 ;; # application/x-rar) rar=1 ;; - # application/x-7z-compressed) z7=1 ;; + # application/x-7z-compressed) ;; # *) tar=1 ;; # esac - # [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}") - # [ $? != 0 ] && bsd=1 && fn=$(bsdtar --list --file "${FILE_PATH}") - # [ $? != 0 ] && [ "$bsd" ] && bsd="" && [ "$tar" -o "$z7"] && return - # if [ -z "$bsd" ] && [ -z "$tar" ]; then - # if [ "$rar" ]; then - # fn=$(unrar lb -p- -- "${FILE_PATH}") - # elif [ "$zip" ]; then - # fn=$(zipinfo -1 -- "${FILE_PATH}") - # fi - # [ $? != 0 ] && return - # fi + # { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \ + # { bsd=1 && fn=$(bsdtar --list --file "${FILE_PATH}"); } || \ + # { bsd="" && [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \ + # { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return # # fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \ # [ print(l, end='') for l in sys.stdin if \ |