summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-07-30 11:21:06 +0100
committerPaul Buetow <paul@buetow.org>2022-07-30 11:21:06 +0100
commitd5ee29f3da9dd09278ebea7464e21fae40911130 (patch)
tree406eabb8891291ff17d6913ef75ec71ebbb31fb7
parent3dcf326d3ab8e416d25477b59573354748b1817e (diff)
automatically check whether date, grep and sed are GNU or not
-rwxr-xr-xgemtexter11
1 files changed, 11 insertions, 0 deletions
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 <<END
@@ -74,6 +84,7 @@ END
main () {
local -r arg="$1"; shift
+ ensure_gnu
setup
case $arg in