Beispiel #1
0
        public static bool TryGetGSDEnlistmentRootImplementation(string directory, string dotGSDRoot, out string enlistmentRoot, out string errorMessage)
        {
            // TODO(POSIX): Merge this code with the implementation in WindowsPlatform

            enlistmentRoot = null;

            string finalDirectory;

            if (!POSIXFileSystem.TryGetNormalizedPathImplementation(directory, out finalDirectory, out errorMessage))
            {
                return(false);
            }

            enlistmentRoot = Paths.GetRoot(finalDirectory, dotGSDRoot);
            if (enlistmentRoot == null)
            {
                errorMessage = $"Failed to find the root directory for {dotGSDRoot} in {finalDirectory}";
                return(false);
            }

            return(true);
        }
 public bool TryGetNormalizedPath(string path, out string normalizedPath, out string errorMessage)
 {
     return(POSIXFileSystem.TryGetNormalizedPathImplementation(path, out normalizedPath, out errorMessage));
 }