diff options
| author | Robert Günzler <r@gnzler.io> | 2025-10-17 22:51:16 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2025-10-18 00:01:46 +0200 |
| commit | 973e5fdb82e0037ba5fc2ff74cf40d32a0e3466b (patch) | |
| tree | 62ec670e836b1e69081c9889fffab4b551de6528 /src/exe.zig | |
| parent | 55efe8b67b850b34c1483ab3be0947d80508a893 (diff) | |
| download | site-973e5fdb82e0037ba5fc2ff74cf40d32a0e3466b.tar.gz | |
get mtime from git
but fallback to mtime anyway Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to 'src/exe.zig')
| -rw-r--r-- | src/exe.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/exe.zig b/src/exe.zig index e0cb7ef..ae5cfdd 100644 --- a/src/exe.zig +++ b/src/exe.zig @@ -37,8 +37,8 @@ fn pandocWorker(ctx: *Context, page: []const u8) !void { defer ctx.allocator().free(target_path); // get mtime of the source document - const mtime = try fs.getMtime(source_path); - const mtime_str = try fs.formatMtime(ctx.allocator(), mtime, "%s"); + const mtime = try (fs.getGitTime(source_path) catch fs.getMtime(source_path)); + const mtime_str = try fs.formatTimespec(ctx.allocator(), mtime, "%s"); defer ctx.allocator().free(mtime_str); const f = try fs.FileSwapper.createAt(ctx.allocator(), target_path); |