Skip to content

Commit

Permalink
fixup: timestamp version
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Sep 18, 2019
1 parent 0f2881e commit 1f5b0da
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dfx/src/lib/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,21 @@ impl VersionEnv for GlobalEnvironment {

impl GlobalEnvironment {
pub fn from_current_dir() -> DfxResult<GlobalEnvironment> {
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(),
})
}
}

0 comments on commit 1f5b0da

Please sign in to comment.