From 61160f736670bbac3ce3ec90960642eb6f8e9995 Mon Sep 17 00:00:00 2001 From: Robert Muehsig Date: Sat, 4 Nov 2017 22:42:08 +0100 Subject: [PATCH] fix for https://github.com/ElectronNET/Electron.NET/issues/30 --- ElectronNET.CLI/Commands/InitCommand.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ElectronNET.CLI/Commands/InitCommand.cs b/ElectronNET.CLI/Commands/InitCommand.cs index b78bef6..0d17e1e 100644 --- a/ElectronNET.CLI/Commands/InitCommand.cs +++ b/ElectronNET.CLI/Commands/InitCommand.cs @@ -91,6 +91,13 @@ namespace ElectronNET.CLI.Commands // this is should solve the problem for 80% of the users // for the other 20% we might fail... var launchSettingFile = Path.Combine(currentDirectory, "Properties", "launchSettings.json"); + + if (File.Exists(launchSettingFile) == false) + { + Console.WriteLine("launchSettings.json not found - do nothing."); + return; + } + string launchSettingText = File.ReadAllText(launchSettingFile); if (launchSettingText.Contains("electronize start") == false)