private DirectoryInfo GetRootDirectory(out MarkerFile markerFile) { DirectoryInfo currentDir = CurrentDirectory; markerFile = null; while (currentDir != null && !IsRootDirectory(currentDir, out markerFile)) { currentDir = currentDir.Parent; } return(currentDir); }
private bool IsRootDirectory(DirectoryInfo directory, out MarkerFile markerFile) { string rootMarkerFilePath = Path.Combine(directory.FullName, ".mr.manifest"); if (!File.Exists(rootMarkerFilePath)) { markerFile = null; return(false); } string markerContent = File.ReadAllText(rootMarkerFilePath); markerFile = JsonConvert.DeserializeObject <MarkerFile>(markerContent); return(true); }