From e9422fb0e07ecc8b81450307f5ce9c7231c46283 Mon Sep 17 00:00:00 2001 From: Paul DeVito Date: Tue, 19 Apr 2022 21:49:37 -0400 Subject: [PATCH] fix: bff readme and program target proper filenames --- Craftsman/Builders/Bff/AppSettingsBuilder.cs | 4 ++-- Craftsman/Builders/Bff/BffReadmeBuilder.cs | 2 +- Craftsman/Builders/Bff/ProgramBuilder.cs | 2 +- Craftsman/Builders/Docker/BffDockerfileBuilder.cs | 2 +- Craftsman/Commands/AddBffCommand.cs | 2 +- Craftsman/Helpers/ClassPathHelper.cs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Craftsman/Builders/Bff/AppSettingsBuilder.cs b/Craftsman/Builders/Bff/AppSettingsBuilder.cs index f3a32dbc..ef8c148c 100644 --- a/Craftsman/Builders/Bff/AppSettingsBuilder.cs +++ b/Craftsman/Builders/Bff/AppSettingsBuilder.cs @@ -9,9 +9,9 @@ public class AppSettingsBuilder { - public static void CreateBffAppSettings(string projectDirectory, string projectName, IFileSystem fileSystem) + public static void CreateBffAppSettings(string projectDirectory, IFileSystem fileSystem) { - var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"appsettings.json", projectName); + var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"appsettings.json"); var fileText = @$"{{ ""AllowedHosts"": ""*"" }} diff --git a/Craftsman/Builders/Bff/BffReadmeBuilder.cs b/Craftsman/Builders/Bff/BffReadmeBuilder.cs index f97c8173..8ef18c09 100644 --- a/Craftsman/Builders/Bff/BffReadmeBuilder.cs +++ b/Craftsman/Builders/Bff/BffReadmeBuilder.cs @@ -9,7 +9,7 @@ public class BffReadmeBuilder { public static void CreateReadme(string projectDirectory, string projectName, IFileSystem fileSystem) { - var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"Program.cs", projectName); + var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"README.md"); var fileText = GetReadmeFileText(projectName); Utilities.CreateFile(classPath, fileText, fileSystem); } diff --git a/Craftsman/Builders/Bff/ProgramBuilder.cs b/Craftsman/Builders/Bff/ProgramBuilder.cs index 36ffc1c5..c772676d 100644 --- a/Craftsman/Builders/Bff/ProgramBuilder.cs +++ b/Craftsman/Builders/Bff/ProgramBuilder.cs @@ -8,7 +8,7 @@ public class ProgramBuilder { public static void CreateProgram(string projectDirectory, string solutionDirectory, string projectName, BffTemplate template, IFileSystem fileSystem) { - var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"Program.cs", projectName); + var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"Program.cs"); var fileText = GetProgramText(template, solutionDirectory, projectName); Utilities.CreateFile(classPath, fileText, fileSystem); } diff --git a/Craftsman/Builders/Docker/BffDockerfileBuilder.cs b/Craftsman/Builders/Docker/BffDockerfileBuilder.cs index 9d7bb1cc..395e8ab4 100644 --- a/Craftsman/Builders/Docker/BffDockerfileBuilder.cs +++ b/Craftsman/Builders/Docker/BffDockerfileBuilder.cs @@ -8,7 +8,7 @@ public static class BffDockerfileBuilder public static void CreateBffDotNetDockerfile(string projectDirectory, string projectBaseName, IFileSystem fileSystem) { - var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"Dockerfile", projectBaseName); + var classPath = ClassPathHelper.BffProjectRootClassPath(projectDirectory, $"Dockerfile"); var fileText = GetDockerfileText(projectBaseName, true, false); Utilities.CreateFile(classPath, fileText, fileSystem); } diff --git a/Craftsman/Commands/AddBffCommand.cs b/Craftsman/Commands/AddBffCommand.cs index 794cfe06..d33dddba 100644 --- a/Craftsman/Commands/AddBffCommand.cs +++ b/Craftsman/Commands/AddBffCommand.cs @@ -115,7 +115,7 @@ public static void AddBff(BffTemplate template, string domainDirectory, IFileSys // .NET Project LaunchSettingsBuilder.CreateLaunchSettings(projectDirectory, projectName, template, fileSystem); - AppSettingsBuilder.CreateBffAppSettings(projectDirectory, projectName, fileSystem); + AppSettingsBuilder.CreateBffAppSettings(projectDirectory, fileSystem); LoggingConfigurationBuilder.CreateBffConfigFile(domainDirectory, projectName, fileSystem); ProgramBuilder.CreateProgram(projectDirectory, domainDirectory, projectName, template, fileSystem); diff --git a/Craftsman/Helpers/ClassPathHelper.cs b/Craftsman/Helpers/ClassPathHelper.cs index 9bc54561..e463a8d3 100644 --- a/Craftsman/Helpers/ClassPathHelper.cs +++ b/Craftsman/Helpers/ClassPathHelper.cs @@ -112,7 +112,7 @@ public static ClassPath AuthServerAppSettingsClassPath(string projectDirectory, return new ClassPath(projectDirectory, authServerProjectName, className); } - public static ClassPath BffProjectRootClassPath(string projectDirectory, string className, string projectName) + public static ClassPath BffProjectRootClassPath(string projectDirectory, string className) { return new ClassPath(projectDirectory, "", className); }