From 25f35e34fef8392d43e6d176f927fa1c174b781f Mon Sep 17 00:00:00 2001 From: Robert Muehsig Date: Mon, 7 Oct 2019 22:53:50 +0200 Subject: [PATCH] global npm outside of build commands --- ElectronNET.CLI/Commands/BuildCommand.cs | 20 +------------------- buildAll.cmd | 5 +++++ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/ElectronNET.CLI/Commands/BuildCommand.cs b/ElectronNET.CLI/Commands/BuildCommand.cs index d9eb03a..7f89e45 100644 --- a/ElectronNET.CLI/Commands/BuildCommand.cs +++ b/ElectronNET.CLI/Commands/BuildCommand.cs @@ -105,20 +105,6 @@ namespace ElectronNET.CLI.Commands Console.WriteLine("Start npm install..."); ProcessHelper.CmdExecute("npm install --production", tempPath); - Console.WriteLine("Start npm install electron-builder..."); - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - // Works proper on Windows... - ProcessHelper.CmdExecute("npm install electron-builder --global", tempPath); - } - else - { - // ToDo: find another solution or document it proper - // GH Issue https://github.com/electron-userland/electron-prebuilt/issues/48 - Console.WriteLine("Electron Builder - make sure you invoke 'sudo npm install electron-builder --global' & 'sudo npm install typescript --global' at " + tempPath + " manually. Sry."); - } - Console.WriteLine("ElectronHostHook handling started..."); string electronhosthookDir = Path.Combine(Directory.GetCurrentDirectory(), "ElectronHostHook"); @@ -128,13 +114,9 @@ namespace ElectronNET.CLI.Commands string hosthookDir = Path.Combine(tempPath, "ElectronHostHook"); DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List() { "node_modules" }); - Console.WriteLine("Start npm install for typescript & hosthooks..."); - ProcessHelper.CmdExecute("npm install -g typescript", hosthookDir); + Console.WriteLine("Start npm install for hosthooks..."); ProcessHelper.CmdExecute("npm install --production", hosthookDir); - // ToDo: Global TypeScript installation is needed for ElectronHostHook - //string tscPath = Path.Combine(tempPath, "node_modules", ".bin"); - // ToDo: Not sure if this runs under linux/macos ProcessHelper.CmdExecute(@"tsc -p . --sourceMap false", hosthookDir); } diff --git a/buildAll.cmd b/buildAll.cmd index 04a7839..536f569 100755 --- a/buildAll.cmd +++ b/buildAll.cmd @@ -1,4 +1,9 @@ echo "Start building Electron.NET dev stack..." + +echo "Install NPM dependencies: Typescript and Bundler" +npm install typescript --global +npm install electron-builder --global + echo "Restore & Build API" cd ElectronNet.API dotnet restore