File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -20,38 +20,38 @@ function date_from_front_matter() {
20
20
21
21
function main () {
22
22
POSTS_DIR=" _posts"
23
-
23
+
24
24
file_count=0
25
25
inconsistent_count=0
26
26
{
27
27
shopt -s nullglob;
28
28
for file_path in " ${POSTS_DIR} " /* .md ; do
29
29
(( file_count = file_count + 1 ))
30
-
30
+
31
31
file_basename=$( basename " $file_path " .md)
32
32
33
33
date_from_filename=$( date_from_filename " $file_basename " )
34
34
date_from_front_matter=$( date_from_front_matter " ${file_path} " )
35
35
36
36
if [[ " ${date_from_filename} " = ' ' ]] ||
37
- [[ " ${date_from_filename} " != " ${date_from_front_matter} " ]]
37
+ [[ " ${date_from_filename} " != " ${date_from_front_matter} " ]]
38
38
then
39
39
warn " Inconsist or missing date info: ${file_path} "
40
40
warn " Date From Filename: '${date_from_filename} '"
41
41
warn " Date From Front Matter: '${date_from_front_matter} '"
42
42
(( inconsistent_count= inconsistent_count + 1 ))
43
43
else
44
- # warn "Consistent|${file_path}|${filename }|${date_from_filename}|${date_from_front_matter}|"
44
+ # warn "Consistent|${file_path}|${file_basename }|${date_from_filename}|${date_from_front_matter}|"
45
45
:
46
46
fi
47
47
done
48
48
}
49
-
49
+
50
50
if (( $inconsistent_count > 0 )) ; then
51
- warn " Inconsistencies detected in $inconsistent_count file."
52
- exit 1
51
+ warn " Inconsistencies detected in $inconsistent_count file."
52
+ exit 1
53
53
else
54
- warn " All dates are consistent in $file_count files."
54
+ warn " All dates are consistent in $file_count files."
55
55
fi
56
56
}
57
57
You can’t perform that action at this time.
0 commit comments