From f7580b8fdc0357c34f57148e1e0c14c253308bc1 Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Fri, 27 Jan 2023 09:26:49 -0500 Subject: [PATCH] Add xargs/findutils dependency check --- lug-helper.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lug-helper.sh b/lug-helper.sh index 5280962..2c5debb 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -72,11 +72,20 @@ fi # exit 1 #fi if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v sort)" ] || [ ! -x "$(command -v basename)" ] || [ ! -x "$(command -v realpath)" ] || [ ! -x "$(command -v dirname)" ]; then + # coreutils # Print to stderr and also try warning the user through notify-send printf "lug-helper.sh: One or more required packages were not found on this system.\nPlease check that the following coreutils packages are installed:\n- mktemp\n- sort\n- basename\n- realpath\n- dirname\n" 1>&2 notify-send "lug-helper" "One or more required packages were not found on this system.\nPlease check that the following coreutils packages are installed:\n- mktemp\n- sort\n- basename\n- realpath\n- dirname\n" --icon=dialog-warning exit 1 fi +if [ ! -x "$(command -v xargs)" ]; then + # findutils + # Print to stderr and also try warning the user through notify-send + printf "lug-helper.sh: One or more required packages were not found on this system.\nPlease check that the following findutils packages are installed:\n- xargs\n" 1>&2 + notify-send "lug-helper" "One or more required packages were not found on this system.\nPlease check that the following findutils packages are installed:\n- xargs\n" --icon=dialog-warning + exit 1 +fi + ######## Config ############################################################