mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
Merge 54a7a5069c
into 696110eae5
This commit is contained in:
commit
c354736392
|
@ -1,7 +1,14 @@
|
||||||
|
use chrono::{TimeZone, Utc};
|
||||||
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Add current date as a variable to be displayed in the 'Linux Toolbox' text.
|
// 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!(
|
println!(
|
||||||
"cargo:rustc-env=BUILD_DATE={}",
|
"cargo:rustc-env=BUILD_DATE={}",
|
||||||
chrono::Local::now().format("%Y-%m-%d")
|
now.format("%Y-%m-%d")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user