summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-08-05 15:09:09 +0300
committerLars Wirzenius <liw@liw.fi>2022-08-05 17:00:19 +0300
commitd9f66f00a5898b4a3cf2ea8ada9a2d08f34c670e (patch)
tree460752d8e864237774947a3515bcb35435b3dc2e /src/error.rs
parentfe85456490c4f297dbd9b773cf5c3b8c6b053c42 (diff)
downloadriki-d9f66f00a5898b4a3cf2ea8ada9a2d08f34c670e.tar.gz
feat: set file commit time to git commit timestamp, unless changed
If a file is committed to git and hasn't been changed, use the latest commit time for the file as the timestamp of the output file. This lacks tests, as I find it too much of a bother to set up git histories with timestamps. Sponsored-by: author
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index aee8252..4fdcc1f 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -64,4 +64,13 @@ pub enum SiteError {
#[error("failed to convert time to Unix time")]
UnixTime(#[source] std::time::SystemTimeError),
+
+ #[error("failed to parse Unix timetamp: {0}")]
+ ParseUnixTimestamp(String, #[source] std::num::ParseIntError),
+
+ #[error("faileed to invoked git with subcommand {0} in {1}")]
+ GitInvoke(String, PathBuf, #[source] std::io::Error),
+
+ #[error("git {0} in in {1}:\n{2}")]
+ GitError(String, PathBuf, String),
}