Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call electronize from the Path instead of via dotnet in launchSettings.json #243

Merged
merged 1 commit into from
May 15, 2019
Merged
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
13 changes: 7 additions & 6 deletions ElectronNET.CLI/Commands/InitCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 7 additions & 5 deletions ElectronNET.WebApp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
}
},
"profiles": {
"Electron.NET App": {
"commandName": "Executable",
"executablePath": "electronize",
"commandLineArgs": "start",
"workingDirectory": "."
},

"IIS Express": {
"commandName": "IISExpress",
"environmentVariables": {
Expand All @@ -22,10 +29,5 @@
},
"applicationUrl": "http://localhost:50395/"
},
"Electron.NET App": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\dotnet\\dotnet.exe",
"commandLineArgs": "electronize start"
}
}
}