]> git.lizzy.rs Git - rust.git/commitdiff
fix: add date to the version string on Mac
authorAleksey Kladov <aleksey.kladov@gmail.com>
Mon, 26 Apr 2021 12:20:15 +0000 (15:20 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Mon, 26 Apr 2021 12:20:15 +0000 (15:20 +0300)
It doesn't support `--iso`

crates/rust-analyzer/build.rs
xtask/src/main.rs

index 25627c7e9b2ec76d8b7d52723af0ba17bda2d0a1..780d247c90b1f1b44704454ee8026a43a1817a59 100644 (file)
@@ -55,7 +55,7 @@ fn commit_hash() -> Option<String> {
 }
 
 fn build_date() -> Option<String> {
-    output_to_string("date --iso --utc")
+    output_to_string("date --utc +%Y-%m-%d")
 }
 
 fn output_to_string(command: &str) -> Option<String> {
index e0e620c762d7b10f231589752046021e6cd1ece2..01bf6e70def963dd80d82f1e6b03e00044f65eca 100644 (file)
@@ -108,7 +108,7 @@ fn run_fuzzer() -> Result<()> {
 }
 
 fn date_iso() -> Result<String> {
-    let res = cmd!("date --iso --utc").read()?;
+    let res = cmd!("date --utc +%Y-%m-%d").read()?;
     Ok(res)
 }