1
0
mirror of https://github.com/jht5945/buildj.git synced 2025-12-27 17:20:06 +08:00

build date

This commit is contained in:
2019-08-09 00:28:29 +08:00
parent 9bcff398a4
commit 0a502d0f38
2 changed files with 2 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ fn main() {
let output = Command::new("git").args(&["rev-parse", "HEAD"]).output().unwrap();
let git_hash = String::from_utf8(output.stdout).unwrap();
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
let date_output = Command::new("date").output().unwrap();
let date_output = Command::new("date").args(&["+%Y-%m-%dT%H:%M:%S%z"]).output().unwrap();
let date = String::from_utf8(date_output.stdout).unwrap();
println!("cargo:rustc-env=BUILD_DATE={}", date);
}

View File

@@ -142,7 +142,7 @@ fn main() {
if *VERBOSE {
print_message(MessageType::DEBUG, &format!("Full GIT_HASH: {}", GIT_HASH));
print_message(MessageType::DEBUG, &format!("Binary build date: {}", BUILD_DATE));
print_message(MessageType::DEBUG, &format!("Build date: {}", BUILD_DATE));
}
let args = local_util::get_args_as_vec();