Skip to content

Commit 73f7e5a

Browse files
Merge pull request #243 from Hecatron-Forks/hecatron-dev
Call electronize from the Path instead of via dotnet in launchSettings.json
2 parents 01d1397 + 4235aa4 commit 73f7e5a

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

ElectronNET.CLI/Commands/InitCommand.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,16 @@ private static void EditLaunchSettings(string currentDirectory)
100100

101101
string launchSettingText = File.ReadAllText(launchSettingFile);
102102

103-
if (launchSettingText.Contains("electronize start") == false)
103+
if (launchSettingText.Contains("\"executablePath\": \"electronize\"") == false)
104104
{
105105
StringBuilder debugProfileBuilder = new StringBuilder();
106106
debugProfileBuilder.AppendLine("profiles\": {");
107-
debugProfileBuilder.AppendLine("\"Electron.NET App\": {");
108-
debugProfileBuilder.AppendLine("\"commandName\": \"Executable\",");
109-
debugProfileBuilder.AppendLine("\"executablePath\": \"C:\\\\Program Files\\\\dotnet\\\\dotnet.exe\",");
110-
debugProfileBuilder.AppendLine("\"commandLineArgs\": \"electronize start\"");
111-
debugProfileBuilder.AppendLine("},");
107+
debugProfileBuilder.AppendLine(" \"Electron.NET App\": {");
108+
debugProfileBuilder.AppendLine(" \"commandName\": \"Executable\",");
109+
debugProfileBuilder.AppendLine(" \"executablePath\": \"electronize\",");
110+
debugProfileBuilder.AppendLine(" \"commandLineArgs\": \"start\",");
111+
debugProfileBuilder.AppendLine(" \"workingDirectory\": \".\"");
112+
debugProfileBuilder.AppendLine(" },");
112113

113114
launchSettingText = launchSettingText.Replace("profiles\": {", debugProfileBuilder.ToString());
114115
File.WriteAllText(launchSettingFile, launchSettingText);

ElectronNET.WebApp/Properties/launchSettings.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
}
99
},
1010
"profiles": {
11+
"Electron.NET App": {
12+
"commandName": "Executable",
13+
"executablePath": "electronize",
14+
"commandLineArgs": "start",
15+
"workingDirectory": "."
16+
},
17+
1118
"IIS Express": {
1219
"commandName": "IISExpress",
1320
"environmentVariables": {
@@ -22,10 +29,5 @@
2229
},
2330
"applicationUrl": "http://localhost:50395/"
2431
},
25-
"Electron.NET App": {
26-
"commandName": "Executable",
27-
"executablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
28-
"commandLineArgs": "electronize start"
29-
}
3032
}
3133
}

0 commit comments

Comments
 (0)