Skip to content

Commit 1f5b0da

Browse files
committed
fixup: timestamp version
1 parent 0f2881e commit 1f5b0da

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

dfx/src/lib/env.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,21 @@ impl VersionEnv for GlobalEnvironment {
174174

175175
impl GlobalEnvironment {
176176
pub fn from_current_dir() -> DfxResult<GlobalEnvironment> {
177-
let mut version = DFX_VERSION.to_owned();
178-
179177
#[cfg(debug_assertions)]
180178
{
181179
// In debug, add a timestamp of the compilation at the end of version to ensure all
182180
// debug runs are unique (and cached uniquely).
183-
version = version + "-" + env!("DFX_TIMESTAMP_DEBUG_MODE_ONLY");
181+
return Ok(GlobalEnvironment {
182+
version: format!(
183+
"{}-{}",
184+
version,
185+
std::env::var_os("DFX_TIMESTAMP_DEBUG_MODE_ONLY").unwrap_or("local-debug")
186+
),
187+
});
184188
}
185189

186-
Ok(GlobalEnvironment { version })
190+
Ok(GlobalEnvironment {
191+
version: DFX_VERSION.to_owned(),
192+
})
187193
}
188194
}

0 commit comments

Comments
 (0)