mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-21 22:45:20 +00:00
Merge pull request #342 from jamiebrynes7/bugfix/check-required-args
Handle missing `/target` argument for `build` command.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -50,6 +50,13 @@ namespace ElectronNET.CLI.Commands
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user