If we provide the Version parameter and haven't included the version or product version dotnet flag then add them.

Fixes: #584
This commit is contained in:
tub5
2021-07-02 16:07:31 +01:00
parent 0e22ee3fd3
commit 0af664b8a6

View File

@@ -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('=');