From 1f5b0da5c883e75b792c16587d3a68d69d6e9119 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Wed, 18 Sep 2019 08:18:42 -0700 Subject: [PATCH] fixup: timestamp version --- dfx/src/lib/env.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dfx/src/lib/env.rs b/dfx/src/lib/env.rs index 02eea9d474..c2f7f4dd28 100644 --- a/dfx/src/lib/env.rs +++ b/dfx/src/lib/env.rs @@ -174,15 +174,21 @@ impl VersionEnv for GlobalEnvironment { impl GlobalEnvironment { pub fn from_current_dir() -> DfxResult { - let mut version = DFX_VERSION.to_owned(); - #[cfg(debug_assertions)] { // In debug, add a timestamp of the compilation at the end of version to ensure all // debug runs are unique (and cached uniquely). - version = version + "-" + env!("DFX_TIMESTAMP_DEBUG_MODE_ONLY"); + return Ok(GlobalEnvironment { + version: format!( + "{}-{}", + version, + std::env::var_os("DFX_TIMESTAMP_DEBUG_MODE_ONLY").unwrap_or("local-debug") + ), + }); } - Ok(GlobalEnvironment { version }) + Ok(GlobalEnvironment { + version: DFX_VERSION.to_owned(), + }) } }