Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions ElectronNET.CLI/Commands/StartElectronCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -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<bool> ExecuteAsync()
{
Expand All @@ -50,6 +51,12 @@ public Task<bool> 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)
{
Expand All @@ -59,7 +66,7 @@ public Task<bool> 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)
{
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down