File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
4
+ function warn() { echo " ${@ } " >&2 ; }
5
+
6
+
4
7
function date_from_filename () {
5
8
local f=" ${1} "
6
9
echo " ${f} " |
@@ -26,22 +29,22 @@ function main () {
26
29
date_from_front_matter=$( date_from_front_matter " ${file} " )
27
30
28
31
if [[ " ${date_from_filename} " = ' ' ]] || [[ " ${date_from_filename} " != " ${date_from_front_matter} " ]]; then
29
- echo " Inconsist or missing date info: ${file} "
30
- echo " Date From Filename: '${date_from_filename} '"
31
- echo " Date From Front Matter: '${date_from_front_matter} '"
32
+ warn " Inconsist or missing date info: ${file} "
33
+ warn " Date From Filename: '${date_from_filename} '"
34
+ warn " Date From Front Matter: '${date_from_front_matter} '"
32
35
inconsistent=true
33
36
else
34
- # echo "Consistent|${file}|${filename}|${date_from_filename}|${date_from_front_matter}|"
37
+ # warn "Consistent|${file}|${filename}|${date_from_filename}|${date_from_front_matter}|"
35
38
:
36
39
fi
37
40
done
38
41
39
42
# Exit with error if inconsistencies were found
40
43
if $inconsistent ; then
41
- echo " Inconsistencies detected. Please correct them."
44
+ warn " Inconsistencies detected. Please correct them."
42
45
exit 1
43
46
else
44
- echo " All dates are consistent."
47
+ warn " All dates are consistent."
45
48
fi
46
49
}
47
50
You can’t perform that action at this time.
0 commit comments