From 0af664b8a6fa1290e11c9ea26af8fa6c59ff4070 Mon Sep 17 00:00:00 2001 From: tub5 Date: Fri, 2 Jul 2021 16:07:31 +0100 Subject: [PATCH] If we provide the Version parameter and haven't included the version or product version dotnet flag then add them. Fixes: #584 --- ElectronNET.CLI/Commands/BuildCommand.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ElectronNET.CLI/Commands/BuildCommand.cs b/ElectronNET.CLI/Commands/BuildCommand.cs index 9159baf..d9c0746 100644 --- a/ElectronNET.CLI/Commands/BuildCommand.cs +++ b/ElectronNET.CLI/Commands/BuildCommand.cs @@ -214,6 +214,14 @@ namespace ElectronNET.CLI.Commands {"/p:PublishSingleFile", parser.TryGet(_paramPublishSingleFile, out var psf) ? psf[0] : "true"}, }; + if (parser.Arguments.ContainsKey(_paramVersion)) + { + if(parser.Arguments.Keys.All(key => !key.StartsWith("p:Version=") && !key.StartsWith("property:Version="))) + dotNetPublishFlags.Add("/p:Version", parser.Arguments[_paramVersion][0]); + if(parser.Arguments.Keys.All(key => !key.StartsWith("p:ProductVersion=") && !key.StartsWith("property:ProductVersion="))) + dotNetPublishFlags.Add("/p:ProductVersion", parser.Arguments[_paramVersion][0]); + } + foreach (var parm in parser.Arguments.Keys.Where(key => key.StartsWith("p:") || key.StartsWith("property:"))) { var split = parm.IndexOf('=');