diff options
author | hut <hut@lavabit.com> | 2011-08-10 12:52:17 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-08-10 12:52:17 +0200 |
commit | e77a5e28385f8b191c4331962662c025b422a797 (patch) | |
tree | b6ded331a140642351d9eafe05c2ccdbdbc73e75 | |
parent | d65d3a6da55438a0b2c619d1218f8af50a0468aa (diff) | |
parent | d0d194d886561622f4b5784ec0b23b8450fa8c2f (diff) | |
download | ranger-e77a5e28385f8b191c4331962662c025b422a797.tar.gz |
Merge branch 'atool' of https://github.com/radhermit/ranger
-rwxr-xr-x | ranger/data/scope.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 9f212cae..ca1f7e67 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -30,14 +30,15 @@ extension=$(echo "$path" | grep '\.' | grep -o '[^.]\+$') # Functions: # "have $1" succeeds if $1 is an existing command/installed program function have { type -P "$1" > /dev/null; } -# "sucess" returns the exit code of the first program in the last pipe chain +# "success" returns the exit code of the first program in the last pipe chain function success { test ${PIPESTATUS[0]} = 0; } case "$extension" in # Archive extensions: 7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) - atool -l "$path" | head -n $maxln && exit 3 + als "$path" | head -n $maxln + success && exit 0 || acat "$path" | head -n $maxln && exit 3 exit 1;; # PDF documents: pdf) |