From 0f085fdb1d29e89c831fbe04c7fd0045fa7e538e Mon Sep 17 00:00:00 2001 From: Robert Muehsig Date: Tue, 8 Jan 2019 23:56:19 +0100 Subject: [PATCH] copy the right stuff and invoke npm --- ElectronNET.CLI/Commands/BuildCommand.cs | 6 +++++- ElectronNET.CLI/Commands/StartElectronCommand.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ElectronNET.CLI/Commands/BuildCommand.cs b/ElectronNET.CLI/Commands/BuildCommand.cs index 4a91cd7..e46e6ff 100644 --- a/ElectronNET.CLI/Commands/BuildCommand.cs +++ b/ElectronNET.CLI/Commands/BuildCommand.cs @@ -86,7 +86,11 @@ namespace ElectronNET.CLI.Commands if (Directory.Exists(electronhosthookDir)) { - DirectoryCopy.Do(electronhosthookDir, tempPath, true, new List() { "node_modules" }); + string hosthookDir = Path.Combine(tempPath, "ElectronHostHook"); + DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List() { "node_modules" }); + + Console.WriteLine("Start npm install for hosthooks..."); + ProcessHelper.CmdExecute("npm install", hosthookDir); } DeployEmbeddedElectronFiles.Do(tempPath); diff --git a/ElectronNET.CLI/Commands/StartElectronCommand.cs b/ElectronNET.CLI/Commands/StartElectronCommand.cs index 8b31c3b..1a352bc 100644 --- a/ElectronNET.CLI/Commands/StartElectronCommand.cs +++ b/ElectronNET.CLI/Commands/StartElectronCommand.cs @@ -63,7 +63,11 @@ namespace ElectronNET.CLI.Commands if (Directory.Exists(electronhosthookDir)) { - DirectoryCopy.Do(electronhosthookDir, tempPath, true, new List() { "node_modules" }); + string hosthookDir = Path.Combine(tempPath, "ElectronHostHook"); + DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List() { "node_modules" }); + + Console.WriteLine("Start npm install for hosthooks..."); + ProcessHelper.CmdExecute("npm install", hosthookDir); } DeployEmbeddedElectronFiles.Do(tempPath);