File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -174,15 +174,21 @@ impl VersionEnv for GlobalEnvironment {
174
174
175
175
impl GlobalEnvironment {
176
176
pub fn from_current_dir ( ) -> DfxResult < GlobalEnvironment > {
177
- let mut version = DFX_VERSION . to_owned ( ) ;
178
-
179
177
#[ cfg( debug_assertions) ]
180
178
{
181
179
// In debug, add a timestamp of the compilation at the end of version to ensure all
182
180
// 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
+ } ) ;
184
188
}
185
189
186
- Ok ( GlobalEnvironment { version } )
190
+ Ok ( GlobalEnvironment {
191
+ version : DFX_VERSION . to_owned ( ) ,
192
+ } )
187
193
}
188
194
}
You can’t perform that action at this time.
0 commit comments