/// <summary> /// Get the path of the directory containing the executable file. /// </summary> public static string GetExecutableFileDirectoryPath(this IExecutableFilePathProvider executableFilePathProvider, IStringlyTypedPathOperator stringlyTypedPathOperator) { var executableFilePath = executableFilePathProvider.GetExecutableFilePath(); var executableFileDirectoryPath = stringlyTypedPathOperator.GetDirectoryPathForFilePath(executableFilePath); return(executableFileDirectoryPath); }
/// <summary> /// Performs special solution directory path-relative formatting. /// </summary> public static string GetProjectFilePath(this IStringlyTypedPathOperator stringlyTypedPathOperator, string solutionFilePath, string projectFileRelativePath) { var solutionFileDirectoryPath = stringlyTypedPathOperator.GetDirectoryPathForFilePath(solutionFilePath); var projectFilePath = stringlyTypedPathOperator.Combine(solutionFileDirectoryPath, projectFileRelativePath); return(projectFilePath); }
public FileFormattedMessageSink(IStringlyTypedPathOperator stringlyTypedPathOperator, string messagesOutputFilePath) { // Create the directory if it does not exist. var messagesOutputDirectoryPath = stringlyTypedPathOperator.GetDirectoryPathForFilePath(messagesOutputFilePath); DirectoryHelper.CreateDirectoryOkIfExists(messagesOutputDirectoryPath); // Delete the output file path, if it exists. FileHelper.DeleteOnlyIfExists(messagesOutputFilePath); this.MessagesOutputFilePath = messagesOutputFilePath; }