We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b6af09 commit 0b0e497Copy full SHA for 0b0e497
date.bash
@@ -0,0 +1,18 @@
1
+#!/bin/bash
2
+
3
+# On this date all posts were updated with the date field
4
+# We want to ignore this date
5
+all_change_date=2020-05-12
6
7
+# Go through all files in the wiki folder
8
+for file in `find wiki/ -name '*.md'`; do
9
+ # Get last date on which file was updated
10
+ last_change=$(git log -1 --format="%ad" --date=short $file)
11
+ if [ "$last_change" = "$all_change_date" ]; then
12
+ # If the last change was on the all_change_date
13
+ # set last_change to last change before all_change_date
14
+ last_change=$(git log -1 --format="%ad" --before=$all_change_date --date=short $file)
15
+ fi
16
+ # Replace date filed with last_change
17
+ sed -i "s/date:.*/date: $last_change/" $file;
18
+done
0 commit comments