Skip to content

Commit dd09c3e

Browse files
committed
Get the paths for omnisharp.json & project.json
1 parent 8540228 commit dd09c3e

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

src/SourceBrowser.Site/Controllers/UploadController.cs

+6-22
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,15 @@ public ActionResult Submit(string githubUrl)
5353
return View("Index");
5454
}
5555

56-
// Generate the source browser files for this solution
57-
var solutionPaths = GetSolutionPaths(repoRootPath);
58-
if (solutionPaths.Length == 0)
59-
{
60-
ViewBag.Error = "No C# solution was found. Ensure that a valid .sln file exists within your repository.";
61-
return View("Index");
62-
}
63-
6456
var organizationPath = System.Web.Hosting.HostingEnvironment.MapPath("~/") + "SB_Files\\" + retriever.UserName;
6557
var repoPath = Path.Combine(organizationPath, retriever.RepoName);
6658

59+
60+
// Generate the source browser files for this solution
61+
var solutionPaths = Directory.GetFiles(repoRootPath, "*.sln", SearchOption.AllDirectories);
62+
var omnisharpPaths = Directory.GetFiles(repoRootPath, "omnisharp.json", SearchOption.AllDirectories);
63+
var projectJsonPaths= Directory.GetFiles(repoRootPath, "project.json", SearchOption.AllDirectories);
64+
6765
// TODO: Use parallel for.
6866
// TODO: Process all solutions.
6967
// For now, we're assuming the shallowest and shortest .sln file is the one we're interested in
@@ -121,19 +119,5 @@ public ActionResult Submit(string githubUrl)
121119
}
122120
}
123121
}
124-
125-
/// <summary>
126-
/// Simply searches for the solution files and returns their paths.
127-
/// </summary>
128-
/// <param name="rootDirectory">
129-
/// The root Directory.
130-
/// </param>
131-
/// <returns>
132-
/// The solution paths.
133-
/// </returns>
134-
private string[] GetSolutionPaths(string rootDirectory)
135-
{
136-
return Directory.GetFiles(rootDirectory, "*.sln", SearchOption.AllDirectories);
137-
}
138122
}
139123
}

0 commit comments

Comments
 (0)