From 83588ee90969e6b3f27e02c4e97b975ade427ad0 Mon Sep 17 00:00:00 2001 From: Dmitry A Date: Thu, 12 Dec 2019 18:48:54 +0300 Subject: [PATCH] added /dotnet-configuration parameter for electronize start command --- ElectronNET.CLI/Commands/StartElectronCommand.cs | 11 +++++++++-- README.md | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ElectronNET.CLI/Commands/StartElectronCommand.cs b/ElectronNET.CLI/Commands/StartElectronCommand.cs index e039cc5d..d7f9c02e 100644 --- a/ElectronNET.CLI/Commands/StartElectronCommand.cs +++ b/ElectronNET.CLI/Commands/StartElectronCommand.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -25,6 +25,7 @@ public StartElectronCommand(string[] args) private string _aspCoreProjectPath = "project-path"; private string _arguments = "args"; private string _manifest = "manifest"; + private string _paramDotNetConfig = "dotnet-configuration"; public Task ExecuteAsync() { @@ -50,6 +51,12 @@ public Task ExecuteAsync() aspCoreProjectPath = Directory.GetCurrentDirectory(); } + string configuration = "Debug"; + if (parser.Arguments.ContainsKey(_paramDotNetConfig)) + { + configuration = parser.Arguments[_paramDotNetConfig][0]; + } + string tempPath = Path.Combine(aspCoreProjectPath, "obj", "Host"); if (Directory.Exists(tempPath) == false) { @@ -59,7 +66,7 @@ public Task ExecuteAsync() var platformInfo = GetTargetPlatformInformation.Do(string.Empty, string.Empty); string tempBinPath = Path.Combine(tempPath, "bin"); - var resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} --output \"{tempBinPath}\"", aspCoreProjectPath); + var resultCode = ProcessHelper.CmdExecute($"dotnet publish -r {platformInfo.NetCorePublishRid} -c {configuration} --output \"{tempBinPath}\"", aspCoreProjectPath); if (resultCode != 0) { diff --git a/README.md b/README.md index 90f2777d..d6792c2e 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,13 @@ electronize init ``` electronize start ``` + +this will compile and start Debug configuration. To start other configuration use `/dotnet-configuration` parameter + +``` +electronize start /dotnet-configuration MacOsRelease +``` + ### Note > Only the first electronize start is slow. The next will go on faster.