private IEnumerable <string> GetProjectsFromGlobalJson(string globalJson) { if (!File.Exists(globalJson)) { throw new Exception($"Unable to find global settings file at {globalJson}"); } var searchPaths = ProjectDependencyFinder.GetGlobalPaths(Path.GetDirectoryName(globalJson)); foreach (var searchPath in searchPaths) { var directory = new DirectoryInfo(searchPath); if (!directory.Exists) { continue; } foreach (var projectDirectory in directory.EnumerateDirectories()) { var projectFilePath = Path.Combine(projectDirectory.FullName, "project.json"); if (File.Exists(projectFilePath)) { yield return(projectFilePath); } } } }
private IEnumerable<string> GetProjectsFromGlobalJson(string globalJson) { var searchPaths = ProjectDependencyFinder.GetGlobalPaths(GetGlobalJsonDirectory(globalJson)); foreach (var searchPath in searchPaths) { var directory = new DirectoryInfo(searchPath); if (!directory.Exists) { continue; } foreach (var projectDirectory in directory.EnumerateDirectories()) { var projectFilePath = Path.Combine(projectDirectory.FullName, Project.FileName); if (File.Exists(projectFilePath)) { yield return projectFilePath; } } } }