-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 $* |