From d5ee29f3da9dd09278ebea7464e21fae40911130 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 30 Jul 2022 11:21:06 +0100 Subject: automatically check whether date, grep and sed are GNU or not --- gemtexter | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gemtexter b/gemtexter index ffd128f..3d03189 100755 --- a/gemtexter +++ b/gemtexter @@ -49,6 +49,16 @@ Example: HELPHERE } +# Make sure that there are the correct versions of the dependencies installed. +ensure_gnu () { + for tool in $DATE $SED $GREP; do + if ! $tool --version | grep -q GNU; then + log ERROR "ERROR, \"$tool\" command is not the GNU version, please install!" + exit 2 + fi + done +} + setup () { if [ ! -d "$CONTENT_BASE_DIR" ]; then cat <