/// <summary>
        /// Tests both the development and non-development secrets directory locations for whether they contain a development machine names text file with the given file name.
        /// </summary>
        public static bool DevelopmentMachineNamesTextFileExists(string developmentMachineNamesTextFileName, out string developmentMachineNamesTextFilePath)
        {
            // Order of testing locations is biased towards non-development.
            // Start with the non-development secrets location.
            var nonDevelopmentLocationForDevelopmentMachineNamesTextFile = PathUtilities.Combine(Utilities.NonDevelopmentSecretsDirectoryPathValue, developmentMachineNamesTextFileName);

            if (PathUtilities.ExistsFilePath(nonDevelopmentLocationForDevelopmentMachineNamesTextFile))
            {
                developmentMachineNamesTextFilePath = nonDevelopmentLocationForDevelopmentMachineNamesTextFile;
                return(true);
            }

            // Then try the development secrets location.
            var developmentLocationForDevelopmentMachineNamesTextFile = PathUtilities.Combine(Utilities.DevelopmentSecretsDirectoryPathValue, developmentMachineNamesTextFileName);

            if (PathUtilities.ExistsFilePath(developmentLocationForDevelopmentMachineNamesTextFile))
            {
                developmentMachineNamesTextFilePath = developmentLocationForDevelopmentMachineNamesTextFile;
                return(true);
            }

            // Else, the development machine names text file does not exist.
            developmentMachineNamesTextFilePath = BasePathUtilities.UnsetPathValue;
            return(false);
        }
        public static string GetSecretsFilePath(string fileName)
        {
            var secretsDirectoryPath = Utilities.SecretsDirectoryPathValue;

            var secretFilePath = PathUtilities.Combine(secretsDirectoryPath, fileName);

            return(secretFilePath);
        }
예제 #3
0
        /// <summary>
        /// Returns an ASP.NET Core environment-specific JSON file-name for a base file-name and ASP.NET Core environment name.
        /// </summary>
        public static FileName GetJsonFileNameForEnvironment(FileNameWithoutExtension baseFileNameWithoutExtension, string aspNetCoreEnvironmentName)
        {
            var fileNameWithoutExtension = PathUtilities.Combine(baseFileNameWithoutExtension, aspNetCoreEnvironmentName.AsFileNameSegment()).AsFileNameWithoutExtension();

            var output = PathUtilities.GetFileName(fileNameWithoutExtension, FileExtensions.Json);

            return(output);
        }
예제 #4
0
        public static string AppendDefaultOrganizationDirectory(string directoryPath, IOrganization organization)
        {
            var defaultOrganizationDirectoryNameValue = organization.GetDefaultDirectoryNameValue();

            var output = PathUtilities.Combine(directoryPath, defaultOrganizationDirectoryNameValue);

            return(output);
        }
예제 #5
0
        public static string AppendDropboxDirectory(string directoryPath)
        {
            var output = PathUtilities.Combine(directoryPath, Constants.DropboxDirectoryNameValue);

            return(output);
        }
예제 #6
0
        public static FilePath GetDirectoryBuildPropsFilePath(ProjectDirectoryPath projectDirectoryPath)
        {
            var directoryBuildPropsFilePath = PathUtilities.Combine(projectDirectoryPath.Value, Constants.DirectoryBuildPropsFileName.Value).AsFilePath();

            return(directoryBuildPropsFilePath);
        }