From 183791d4c45d09008887a62d8cdefed406c0f124 Mon Sep 17 00:00:00 2001 From: Micheal Quinn Date: Tue, 8 Oct 2019 22:49:32 -0500 Subject: [PATCH] Adding in a more detailed error message for when an extraction tool is not found in PATH. CentOS 8 Minimal install seems to not include tar... --- src/install/default.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/install/default.txt b/src/install/default.txt index 7eb05603..829e220d 100644 --- a/src/install/default.txt +++ b/src/install/default.txt @@ -23,7 +23,7 @@ # Issues: https://github.com/schollz/croc/issues # # CREATED: 08/10/2019 16:41 -# REVISION: 0.9.0 +# REVISION: 0.9.1 #=============================================================================== set -o nounset # Treat unset variables as an error @@ -330,7 +330,7 @@ extract_file() { tar -xf "${file}" -C "${dir}" rcode="${?}" else - rcode="30" + rcode="31" fi ;; * ) rcode="20";; @@ -610,7 +610,10 @@ main() { print_message "== Failed to determine which extraction tool to use" "error" exit 1 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 else print_message "== Unknown error returned from extraction attempt" "error"