0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

Merge pull request #157 from TheQueasle/centos8_support

Adding in a more detailed error message for when an extraction tool is not found.
This commit is contained in:
Zack 2019-10-09 09:45:08 -07:00 committed by GitHub
commit 41b91a3baf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@
# Issues: https://github.com/schollz/croc/issues # Issues: https://github.com/schollz/croc/issues
# #
# CREATED: 08/10/2019 16:41 # CREATED: 08/10/2019 16:41
# REVISION: 0.9.0 # REVISION: 0.9.1
#=============================================================================== #===============================================================================
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
@ -330,7 +330,7 @@ extract_file() {
tar -xf "${file}" -C "${dir}" tar -xf "${file}" -C "${dir}"
rcode="${?}" rcode="${?}"
else else
rcode="30" rcode="31"
fi fi
;; ;;
* ) rcode="20";; * ) rcode="20";;
@ -610,7 +610,10 @@ main() {
print_message "== Failed to determine which extraction tool to use" "error" print_message "== Failed to determine which extraction tool to use" "error"
exit 1 exit 1
elif [[ "${extract_file_rcode}" == "30" ]]; then elif [[ "${extract_file_rcode}" == "30" ]]; then
print_message "== Failed to find extraction tool in path" "error" print_message "== Failed to find 'unzip' in path" "error"
exit 1
elif [[ "${extract_file_rcode}" == "31" ]]; then
print_message "== Failed to find 'tar' in path" "error"
exit 1 exit 1
else else
print_message "== Unknown error returned from extraction attempt" "error" print_message "== Unknown error returned from extraction attempt" "error"