From dc77203ee24817f71db6df4b1a395cb290f6e19b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 23 Apr 2020 23:41:27 +0200 Subject: [PATCH] fixed file exclusions --- GameBundle/Options.cs | 2 +- GameBundle/Program.cs | 7 +++---- Test/Bundle.bat | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/GameBundle/Options.cs b/GameBundle/Options.cs index 3265fa7..0c4b30c 100644 --- a/GameBundle/Options.cs +++ b/GameBundle/Options.cs @@ -20,7 +20,7 @@ namespace GameBundle { public bool BuildMac { get; set; } [Option('e', "exclude", HelpText = "Files that should not be moved to the library folder")] - public string[] ExcludedFiles { get; set; } + public IEnumerable ExcludedFiles { get; set; } [Option("32-bit", HelpText = "Publish for 32 bit instead of 64 bit. Note that this is only possible on Windows")] public bool Publish32Bit { get; set; } [Option('t', "no-trim", HelpText = "Skip trimming the application when publishing")] diff --git a/GameBundle/Program.cs b/GameBundle/Program.cs index ac7f128..81c7057 100644 --- a/GameBundle/Program.cs +++ b/GameBundle/Program.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using System.Linq; using System.Text.RegularExpressions; using CommandLine; @@ -47,11 +48,9 @@ namespace GameBundle { RunProcess(options, "dotnet", $"publish {proj.FullName} -o {path} -r {rid} -c {options.BuildConfig} /p:PublishTrimmed={!options.NoTrim}"); // Run beauty - var excludes = string.Empty; - if (options.ExcludedFiles.Length > 0) - excludes = '"' + string.Join(";", options.ExcludedFiles) + '"'; + var excludes = '"' + string.Join(";", options.ExcludedFiles) + '"'; var log = options.Verbose ? "Detail" : "Error"; - RunProcess(options, "ncbeauty", $"--loglevel={log} --force=True {path} {options.LibFolder} {excludes}"); + RunProcess(options, "ncbeauty", $"--loglevel={log} --force=True {path} {options.LibFolder} --excludes={excludes}"); // Remove the beauty file since it's just a marker var beautyFile = new FileInfo(Path.Combine(path, "NetCoreBeauty")); diff --git a/Test/Bundle.bat b/Test/Bundle.bat index a89b754..c5a0c02 100644 --- a/Test/Bundle.bat +++ b/Test/Bundle.bat @@ -1 +1 @@ -"../GameBundle/bin/Debug/netcoreapp3.1/GameBundle.exe" -wlm -s Test.csproj -o bin/Bundled \ No newline at end of file +"../GameBundle/bin/Debug/netcoreapp3.1/GameBundle.exe" -wlm -s Test.csproj -o bin/Bundled -v \ No newline at end of file