From b3218532e82b686932020514ff8f4c9c53c9fc82 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 17 Aug 2022 21:49:59 +0200 Subject: [PATCH] added the ability to have additional text in the file name --- GameBundle/Options.cs | 2 ++ GameBundle/Program.cs | 6 ++++-- Test/Bundle.bat | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/GameBundle/Options.cs b/GameBundle/Options.cs index c05493a..f16df56 100644 --- a/GameBundle/Options.cs +++ b/GameBundle/Options.cs @@ -62,6 +62,8 @@ namespace GameBundle { public string BuildArgs { get; set; } [Option('n', "name-builds", HelpText = "Name the build output directories by the name of the executable")] public bool NameBuilds { get; set; } + [Option('N', "name-addition", HelpText = "An additional string of text that should be included in the names of the output directories")] + public string NameAddition { get; set; } } } \ No newline at end of file diff --git a/GameBundle/Program.cs b/GameBundle/Program.cs index efb9d80..8bfff99 100644 --- a/GameBundle/Program.cs +++ b/GameBundle/Program.cs @@ -176,8 +176,10 @@ namespace GameBundle { return new Regex(s.Replace(".", "[.]").Replace("*", ".*").Replace("?", ".")); } - private static DirectoryInfo GetBuildDir(Options options, string osName) { - return new DirectoryInfo(Path.Combine(Path.GetFullPath(options.OutputDirectory), osName)); + private static DirectoryInfo GetBuildDir(Options options, string name) { + if (options.NameAddition != null) + name = $"{options.NameAddition}-{name}"; + return new DirectoryInfo(Path.Combine(Path.GetFullPath(options.OutputDirectory), name)); } private static string GetBuildName(Options options, DirectoryInfo buildDir) { diff --git a/Test/Bundle.bat b/Test/Bundle.bat index c1db647..e8a6459 100644 --- a/Test/Bundle.bat +++ b/Test/Bundle.bat @@ -1 +1 @@ -"../GameBundle/bin/Debug/net6.0/GameBundle.exe" -wlmWL -bzn -s Test.csproj -o bin/Bundled -v --mac-bundle-ignore macmain.txt \ No newline at end of file +"../GameBundle/bin/Debug/net6.0/GameBundle.exe" -wlmWL -bzn -s Test.csproj -o bin/Bundled -v --mac-bundle-ignore macmain.txt -N 1.0.0 \ No newline at end of file