Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tui/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
use chrono::{TimeZone, Utc};
use std::env;

fn main() {
// Add current date as a variable to be displayed in the 'Linux Toolbox' text.
let now = match env::var("SOURCE_DATE_EPOCH") {
Ok(val) => { Utc.timestamp_opt(val.parse::<i64>().unwrap(), 0).unwrap() }
Err(_) => Utc::now(),
};
println!(
"cargo:rustc-env=BUILD_DATE={}",
chrono::Local::now().format("%Y-%m-%d")
now.format("%Y-%m-%d")
);
}