Skip to content

Commit 59cc863

Browse files
committed
Fix file timestamp extraction in tutorial builder
1 parent aa01876 commit 59cc863

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/tutorial/build.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ function fileDates(file, c) {
2424
function takeTime(str) {
2525
return Number(str.match(/^(\S+)\s/)[1]) * 1000;
2626
}
27-
require("child_process").exec("git rev-list --timestamp HEAD -- " + file, function(err, stdout) {
27+
require("child_process").exec("git rev-list --timestamp HEAD -- " + file + ".md", function(err, stdout) {
2828
if (err != null) { console.log("Failed to run git rev-list"); return; }
2929
var history = stdout.split("\n");
3030
if (history.length && history[history.length-1] == "") history.pop();
31-
var created = history.length ? takeTime(history[0]) : Date.now();
31+
var created = history.length ? takeTime(history[history.length-1]) : Date.now();
3232
var modified = created;
33-
if (history.length > 1) modified = takeTime(history[history.length-1]);
33+
if (history.length > 1) modified = takeTime(history[0]);
3434
c(created, modified);
3535
});
3636
}

0 commit comments

Comments
 (0)