File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,9 +62,15 @@ public OS.Directories GetOrCreateDirectories()
6262 dirs . CacheDir = GetXdgDirectory ( "XDG_CACHE_HOME" , Path . Combine ( home , ".cache" ) , "SourceGit" ) ;
6363
6464 // If the app basic dirs already exist, we can skip the migration step
65- if ( Directory . Exists ( dirs . ConfigDir ) )
65+ if ( Directory . Exists ( dirs . ConfigDir ) && Directory . Exists ( dirs . CacheDir ) )
6666 return dirs ;
6767
68+ // Create the config and cache directories if they don't exist
69+ if ( ! Directory . Exists ( dirs . ConfigDir ) )
70+ Directory . CreateDirectory ( dirs . ConfigDir ) ;
71+ if ( ! Directory . Exists ( dirs . CacheDir ) )
72+ Directory . CreateDirectory ( dirs . CacheDir ) ;
73+
6874 // Migrate legacy data dir: ~/.sourcegit to XDG standard directories
6975 var legacyDir = Path . Combine ( home , ".sourcegit" ) ;
7076 if ( Directory . Exists ( legacyDir ) )
@@ -81,12 +87,6 @@ public OS.Directories GetOrCreateDirectories()
8187 }
8288 }
8389
84- // Create the config and cache directories if they don't exist
85- if ( ! Directory . Exists ( dirs . ConfigDir ) )
86- Directory . CreateDirectory ( dirs . ConfigDir ) ;
87- if ( ! Directory . Exists ( dirs . CacheDir ) )
88- Directory . CreateDirectory ( dirs . CacheDir ) ;
89-
9090 return dirs ;
9191 }
9292
You can’t perform that action at this time.
0 commit comments