From b1d0a7d2f52fbf42363e51aaba98285a0a1b946f Mon Sep 17 00:00:00 2001 From: Mysh Date: Wed, 20 Nov 2024 14:04:33 +0100 Subject: [PATCH] feat(yabs.sh): add mandatory check for TAR --- yabs.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/yabs.sh b/yabs.sh index 5bb8320..747a500 100644 --- a/yabs.sh +++ b/yabs.sh @@ -53,7 +53,7 @@ function check_command() { } # Check for required commands and add warnings if not available -REQUIRED_COMMANDS=("locale" "uname" "getconf" "sed" "grep" "cut" "shuf" "timeout" "date" "trap" "df" "free" "systemd-detect-virt") +REQUIRED_COMMANDS=("locale" "uname" "getconf" "sed" "grep" "cut" "shuf" "timeout" "date" "trap" "df" "free" "systemd-detect-virt" "tar") if [[ -n "$PRINT_COMMANDS_CHECK" ]]; then echo -e "\nChecking available commands" @@ -99,6 +99,18 @@ else exit 1 fi +# Check for TAR, needed to open downdloaded Geekbench archive (mandatory!) +if check_command "tar"; then + if [[ -n "$PRINT_COMMANDS_CHECK" ]]; then + echo -e "tar : \xE2\x9C\x94 installed" + fi +else + echo -e "tar : \xE2\x9D\x8C not installed" + echo -e "\nError: 'tar' command not found. Please install it to continue, we need it to open Geekbench.tar.gz." + echo -e + exit 1 +fi + echo -e if check_command "date"; then date