Skip to content

Commit

Permalink
exit if 7z not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mle86 committed Sep 4, 2017
1 parent 4cc8392 commit b53b86c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/walk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ EXIT_EXISTS=2
EXIT_UNKNOWNTYPE=3
EXIT_PACKFAIL=6
EXIT_UNPACKFAIL=7
EXIT_NOPROG=127

msg () { printf '%s\n' "$msgprefix$*" ; }
err () { printf '%s\n' "$errprefix$*" >&2 ; }
Expand Down Expand Up @@ -404,12 +405,12 @@ findbin () {
which "$1" && return
shift
done
err "binary not found: $list"
fail $EXIT_NOPROG "binary not found: $list"
}

_7z () {
local bin
bin=$(findbin 7z 7za 7zr) || return
bin=$(findbin 7z 7za 7zr) || exit $?
"$bin" "$@"
}

Expand Down
1 change: 1 addition & 0 deletions test/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ EXIT_EXISTS=2
EXIT_UNKNOWNTYPE=3
EXIT_PACKFAIL=6
EXIT_UNPACKFAIL=7
EXIT_NOPROG=127


ARCHIVE=
Expand Down

0 comments on commit b53b86c

Please sign in to comment.