File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -174,15 +174,25 @@ 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
+ Ok ( GlobalEnvironment {
182
+ version : format ! (
183
+ "{}-{:?}" ,
184
+ DFX_VERSION . to_owned( ) ,
185
+ std:: env:: var_os( "DFX_TIMESTAMP_DEBUG_MODE_ONLY" )
186
+ . unwrap_or_else( || std:: ffi:: OsString :: from( "local-debug" ) )
187
+ ) ,
188
+ } )
184
189
}
185
190
186
- Ok ( GlobalEnvironment { version } )
191
+ #[ cfg( not( debug_assertions) ) ]
192
+ {
193
+ Ok ( GlobalEnvironment {
194
+ version : DFX_VERSION . to_owned ( ) ,
195
+ } )
196
+ }
187
197
}
188
198
}
You can’t perform that action at this time.
0 commit comments