示例#1
0
        private DirectoryInfo GetRootDirectory(out MarkerFile markerFile)
        {
            DirectoryInfo currentDir = CurrentDirectory;

            markerFile = null;
            while (currentDir != null && !IsRootDirectory(currentDir, out markerFile))
            {
                currentDir = currentDir.Parent;
            }
            return(currentDir);
        }
示例#2
0
        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);
        }