File tree Expand file tree Collapse file tree 1 file changed +20
-19
lines changed Expand file tree Collapse file tree 1 file changed +20
-19
lines changed Original file line number Diff line number Diff line change @@ -40,30 +40,31 @@ const writeMissingConfigs = (
4040}
4141
4242const readOrCreateConfig = ( ) : string | undefined => {
43- const dvcAppDir = getDVCAppDir ( )
44- const iterativeAppDir = getIterativeAppDir ( )
43+ try {
44+ const dvcAppDir = getDVCAppDir ( )
45+ const iterativeAppDir = getIterativeAppDir ( )
4546
46- const legacyDirectory = join ( dvcAppDir , 'user_id' )
47+ const legacyDirectory = join ( dvcAppDir , 'user_id' )
4748
48- const legacyConfigPath = legacyDirectory
49- const legacyConfig = loadConfig ( legacyConfigPath )
49+ const legacyConfigPath = legacyDirectory
50+ const legacyConfig = loadConfig ( legacyConfigPath )
5051
51- const configPath = join ( iterativeAppDir , 'telemetry' )
52- const config = loadConfig ( configPath )
52+ const configPath = join ( iterativeAppDir , 'telemetry' )
53+ const config = loadConfig ( configPath )
5354
54- const user_id = legacyConfig . user_id || config . user_id || v4 ( )
55+ const user_id = legacyConfig . user_id || config . user_id || v4 ( )
5556
56- if ( legacyConfig . user_id !== user_id || config . user_id !== user_id ) {
57- writeMissingConfigs (
58- user_id ,
59- legacyConfig ,
60- legacyConfigPath ,
61- config ,
62- configPath
63- )
64- }
65-
66- return user_id
57+ if ( legacyConfig . user_id !== user_id || config . user_id !== user_id ) {
58+ writeMissingConfigs (
59+ user_id ,
60+ legacyConfig ,
61+ legacyConfigPath ,
62+ config ,
63+ configPath
64+ )
65+ }
66+ return user_id
67+ } catch { }
6768}
6869
6970export const readOrCreateUserId = ( ) => {
You can’t perform that action at this time.
0 commit comments