(sh: &Shell)
| 404 | /// but not second because, well, we're not going to build more than once a second. |
| 405 | #[context("Finding git timestamp")] |
| 406 | fn git_timestamp(sh: &Shell) -> Result<String> { |
| 407 | let ts = cmd!(sh, "git show -s --format=%ct").read()?; |
| 408 | let ts = ts.trim().parse::<i64>()?; |
| 409 | let ts = chrono::DateTime::from_timestamp(ts, 0) |
| 410 | .ok_or_else(|| anyhow::anyhow!("Failed to parse timestamp"))?; |
| 411 | Ok(ts.format("%Y%m%d%H%M").to_string()) |
| 412 | } |
| 413 | |
| 414 | struct Package { |
| 415 | version: String, |