From 4235aa46777bc7b28ecf24686962d18ef4c537d2 Mon Sep 17 00:00:00 2001 From: grbd Date: Wed, 8 May 2019 19:31:29 +0100 Subject: [PATCH] Calls electronize from the Path instead of via dotnet --- ElectronNET.CLI/Commands/InitCommand.cs | 13 +++++++------ ElectronNET.WebApp/Properties/launchSettings.json | 12 +++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ElectronNET.CLI/Commands/InitCommand.cs b/ElectronNET.CLI/Commands/InitCommand.cs index 0d17e1e0..2d63fdeb 100644 --- a/ElectronNET.CLI/Commands/InitCommand.cs +++ b/ElectronNET.CLI/Commands/InitCommand.cs @@ -100,15 +100,16 @@ private static void EditLaunchSettings(string currentDirectory) string launchSettingText = File.ReadAllText(launchSettingFile); - if (launchSettingText.Contains("electronize start") == false) + if (launchSettingText.Contains("\"executablePath\": \"electronize\"") == false) { StringBuilder debugProfileBuilder = new StringBuilder(); debugProfileBuilder.AppendLine("profiles\": {"); - debugProfileBuilder.AppendLine("\"Electron.NET App\": {"); - debugProfileBuilder.AppendLine("\"commandName\": \"Executable\","); - debugProfileBuilder.AppendLine("\"executablePath\": \"C:\\\\Program Files\\\\dotnet\\\\dotnet.exe\","); - debugProfileBuilder.AppendLine("\"commandLineArgs\": \"electronize start\""); - debugProfileBuilder.AppendLine("},"); + debugProfileBuilder.AppendLine(" \"Electron.NET App\": {"); + debugProfileBuilder.AppendLine(" \"commandName\": \"Executable\","); + debugProfileBuilder.AppendLine(" \"executablePath\": \"electronize\","); + debugProfileBuilder.AppendLine(" \"commandLineArgs\": \"start\","); + debugProfileBuilder.AppendLine(" \"workingDirectory\": \".\""); + debugProfileBuilder.AppendLine(" },"); launchSettingText = launchSettingText.Replace("profiles\": {", debugProfileBuilder.ToString()); File.WriteAllText(launchSettingFile, launchSettingText); diff --git a/ElectronNET.WebApp/Properties/launchSettings.json b/ElectronNET.WebApp/Properties/launchSettings.json index efcfd39e..9c1d8f47 100644 --- a/ElectronNET.WebApp/Properties/launchSettings.json +++ b/ElectronNET.WebApp/Properties/launchSettings.json @@ -8,6 +8,13 @@ } }, "profiles": { + "Electron.NET App": { + "commandName": "Executable", + "executablePath": "electronize", + "commandLineArgs": "start", + "workingDirectory": "." + }, + "IIS Express": { "commandName": "IISExpress", "environmentVariables": { @@ -22,10 +29,5 @@ }, "applicationUrl": "http://localhost:50395/" }, - "Electron.NET App": { - "commandName": "Executable", - "executablePath": "C:\\Program Files\\dotnet\\dotnet.exe", - "commandLineArgs": "electronize start" - } } } \ No newline at end of file