diff --git a/Changelog.md b/Changelog.md index 1588b23e..6d9396b3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Not released +ElectronNET.CLI + +* Fixed a bug where `electronize build` with no arguments would throw a `KeyNotFoundException`. + # Released # 5.30.1 diff --git a/ElectronNET.CLI/Commands/BuildCommand.cs b/ElectronNET.CLI/Commands/BuildCommand.cs index ded988c6..79667520 100644 --- a/ElectronNET.CLI/Commands/BuildCommand.cs +++ b/ElectronNET.CLI/Commands/BuildCommand.cs @@ -50,6 +50,13 @@ public Task ExecuteAsync() SimpleCommandLineParser parser = new SimpleCommandLineParser(); parser.Parse(_args); + if (!parser.Arguments.ContainsKey(_paramTarget)) + { + Console.WriteLine($"Error: missing '{_paramTarget}' argument."); + Console.WriteLine(COMMAND_ARGUMENTS); + return false; + } + var desiredPlatform = parser.Arguments[_paramTarget][0]; string specifiedFromCustom = string.Empty; if (desiredPlatform == "custom" && parser.Arguments[_paramTarget].Length > 1)