Skip to content

Commit 25f35e3

Browse files
committed
global npm outside of build commands
1 parent f1eaffb commit 25f35e3

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

ElectronNET.CLI/Commands/BuildCommand.cs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,6 @@ public Task<bool> ExecuteAsync()
105105
Console.WriteLine("Start npm install...");
106106
ProcessHelper.CmdExecute("npm install --production", tempPath);
107107

108-
Console.WriteLine("Start npm install electron-builder...");
109-
110-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
111-
{
112-
// Works proper on Windows...
113-
ProcessHelper.CmdExecute("npm install electron-builder --global", tempPath);
114-
}
115-
else
116-
{
117-
// ToDo: find another solution or document it proper
118-
// GH Issue https://github.com/electron-userland/electron-prebuilt/issues/48
119-
Console.WriteLine("Electron Builder - make sure you invoke 'sudo npm install electron-builder --global' & 'sudo npm install typescript --global' at " + tempPath + " manually. Sry.");
120-
}
121-
122108
Console.WriteLine("ElectronHostHook handling started...");
123109

124110
string electronhosthookDir = Path.Combine(Directory.GetCurrentDirectory(), "ElectronHostHook");
@@ -128,13 +114,9 @@ public Task<bool> ExecuteAsync()
128114
string hosthookDir = Path.Combine(tempPath, "ElectronHostHook");
129115
DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List<string>() { "node_modules" });
130116

131-
Console.WriteLine("Start npm install for typescript & hosthooks...");
132-
ProcessHelper.CmdExecute("npm install -g typescript", hosthookDir);
117+
Console.WriteLine("Start npm install for hosthooks...");
133118
ProcessHelper.CmdExecute("npm install --production", hosthookDir);
134119

135-
// ToDo: Global TypeScript installation is needed for ElectronHostHook
136-
//string tscPath = Path.Combine(tempPath, "node_modules", ".bin");
137-
138120
// ToDo: Not sure if this runs under linux/macos
139121
ProcessHelper.CmdExecute(@"tsc -p . --sourceMap false", hosthookDir);
140122
}

buildAll.cmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
echo "Start building Electron.NET dev stack..."
2+
3+
echo "Install NPM dependencies: Typescript and Bundler"
4+
npm install typescript --global
5+
npm install electron-builder --global
6+
27
echo "Restore & Build API"
38
cd ElectronNet.API
49
dotnet restore

0 commit comments

Comments
 (0)