From a18daa918cb2f7e0dc101a42622034c6134f9987 Mon Sep 17 00:00:00 2001 From: Julian Payne Date: Thu, 6 Jun 2024 18:25:16 +0200 Subject: [PATCH] feat: run the arguments that we get --- run-shell-script.sh | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/run-shell-script.sh b/run-shell-script.sh index ac52359..2df38b9 100755 --- a/run-shell-script.sh +++ b/run-shell-script.sh @@ -1,24 +1,6 @@ #!/usr/bin/env bash # turn on echo -# set -x +set -x -today=$(date +"%Y-%m-%d") -files=$(echo $* | xargs -n1 | egrep "machine-learning-cp.md|machine-learning.md|watsonx-ai.md|watsonx-ai-cp.md" | tr '\n' ' ') - -function validate_lastupdated() { - cat $1 | grep lastupdated | awk '{print $2; exit}' | tr -d '"' -} - -echo "Checking files $files for date $today" - -for f in ${files}; do - last_updated=$(validate_lastupdated $f) - echo "Found last updated ${last_updated} in $f" - if [[ "${last_updated}" != "${today}" ]]; then - echo "***ERROR*** found wrong date in ${f}: expecting ${today} but found ${last_updated}" - exit 1 - fi -done - -exit 0 +sh $*