@@ -37,6 +37,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
37
37
{
38
38
if ( valueName . IndexOf ( "RecentlyUsedProjectPaths-" ) == 0 )
39
39
{
40
+ bool folderExists = false ;
40
41
string projectPath = "" ;
41
42
// check if binary or not
42
43
var valueKind = key . GetValueKind ( valueName ) ;
@@ -51,7 +52,8 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
51
52
}
52
53
53
54
// first check if whole folder exists, if not, skip
54
- if ( showMissingFolders == false && Directory . Exists ( projectPath ) == false )
55
+ folderExists = Directory . Exists ( projectPath ) ;
56
+ if ( showMissingFolders == false && folderExists == false )
55
57
{
56
58
//Console.WriteLine("Recent project directory not found, skipping: " + projectPath);
57
59
continue ;
@@ -76,48 +78,48 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
76
78
string csprojFile = Path . Combine ( projectPath , projectName + ".csproj" ) ;
77
79
78
80
// solution only
79
- if ( File . Exists ( csprojFile ) == false )
81
+ if ( folderExists == true && File . Exists ( csprojFile ) == false )
80
82
{
81
83
csprojFile = Path . Combine ( projectPath , projectName + ".sln" ) ;
82
84
}
83
85
84
86
// editor only project
85
- if ( File . Exists ( csprojFile ) == false )
87
+ if ( folderExists == true && File . Exists ( csprojFile ) == false )
86
88
{
87
89
csprojFile = Path . Combine ( projectPath , projectName + ".Editor.csproj" ) ;
88
90
}
89
91
90
92
// maybe 4.x project, NOTE recent versions also have this as default
91
- if ( File . Exists ( csprojFile ) == false )
93
+ if ( folderExists == true && File . Exists ( csprojFile ) == false )
92
94
{
93
95
csprojFile = Path . Combine ( projectPath , "Assembly-CSharp.csproj" ) ;
94
96
}
95
97
96
98
// get last modified date
97
- DateTime ? lastUpdated = Tools . GetLastModifiedTime ( csprojFile ) ;
99
+ DateTime ? lastUpdated = folderExists ? Tools . GetLastModifiedTime ( csprojFile ) : null ;
98
100
99
101
// get project version
100
- string projectVersion = Tools . GetProjectVersion ( projectPath ) ;
102
+ string projectVersion = folderExists ? Tools . GetProjectVersion ( projectPath ) : null ;
101
103
102
104
// get custom launch arguments, only if column in enabled
103
105
string customArgs = "" ;
104
106
if ( getArguments == true )
105
107
{
106
- customArgs = Tools . ReadCustomLaunchArguments ( projectPath , MainWindow . launcherArgumentsFile ) ;
108
+ customArgs = folderExists ? Tools . ReadCustomLaunchArguments ( projectPath , MainWindow . launcherArgumentsFile ) : null ;
107
109
}
108
110
109
111
// get git branchinfo, only if column in enabled
110
112
string gitBranch = "" ;
111
113
if ( getGitBranch == true )
112
114
{
113
- gitBranch = Tools . ReadGitBranchInfo ( projectPath ) ;
115
+ gitBranch = folderExists ? Tools . ReadGitBranchInfo ( projectPath ) : null ;
114
116
}
115
117
116
118
// TODO add option to disable check
117
119
string targetPlatform = "" ;
118
120
if ( showTargetPlatform == true )
119
121
{
120
- targetPlatform = Tools . ParseTargetPlatform ( projectPath ) ;
122
+ targetPlatform = folderExists ? Tools . ParseTargetPlatform ( projectPath ) : null ;
121
123
}
122
124
123
125
var p = new Project ( ) ;
@@ -128,6 +130,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
128
130
p . Arguments = customArgs ;
129
131
p . GITBranch = gitBranch ;
130
132
p . TargetPlatform = targetPlatform ;
133
+ p . folderExists = folderExists ;
131
134
132
135
// if want to hide project and folder path for screenshot
133
136
//p.Title = "Hidden Project";
0 commit comments