Skip to content

Commit 2b3eabf

Browse files
committed
test
1 parent 27a5057 commit 2b3eabf

File tree

2 files changed

+35
-20
lines changed

2 files changed

+35
-20
lines changed

ElectronNET.CLI/Commands/BuildCommand.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,7 @@ public Task<bool> ExecuteAsync()
8282
return false;
8383
}
8484

85-
string electronhosthookDir = Path.Combine(Directory.GetCurrentDirectory(), "ElectronHostHook");
8685

87-
if (Directory.Exists(electronhosthookDir))
88-
{
89-
string hosthookDir = Path.Combine(tempPath, "ElectronHostHook");
90-
DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List<string>() { "node_modules" });
91-
92-
Console.WriteLine("Start npm install for hosthooks...");
93-
ProcessHelper.CmdExecute("npm install", hosthookDir);
94-
}
9586

9687
DeployEmbeddedElectronFiles.Do(tempPath);
9788

@@ -123,6 +114,23 @@ public Task<bool> ExecuteAsync()
123114
Console.WriteLine("Skip npm install, because node_modules directory exists in: " + checkForNodeModulesDirPath);
124115
}
125116

117+
Console.WriteLine("ElectronHostHook handling started...");
118+
119+
string electronhosthookDir = Path.Combine(Directory.GetCurrentDirectory(), "ElectronHostHook");
120+
121+
if (Directory.Exists(electronhosthookDir))
122+
{
123+
string hosthookDir = Path.Combine(tempPath, "ElectronHostHook");
124+
DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List<string>() { "node_modules" });
125+
126+
Console.WriteLine("Start npm install for hosthooks...");
127+
ProcessHelper.CmdExecute("npm install", hosthookDir);
128+
129+
string tscPath = Path.Combine(tempPath, "node_modules", ".bin");
130+
// ToDo: Not sure if this runs under linux/macos
131+
ProcessHelper.CmdExecute(@"tsc -p ../../ElectronHostHook", tscPath);
132+
}
133+
126134
Console.WriteLine("Build Electron Desktop Application...");
127135
string buildPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "desktop");
128136

ElectronNET.CLI/Commands/StartElectronCommand.cs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,6 @@ public Task<bool> ExecuteAsync()
5959
return false;
6060
}
6161

62-
string electronhosthookDir = Path.Combine(aspCoreProjectPath, "ElectronHostHook");
63-
64-
if (Directory.Exists(electronhosthookDir))
65-
{
66-
string hosthookDir = Path.Combine(tempPath, "ElectronHostHook");
67-
DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List<string>() { "node_modules" });
68-
69-
Console.WriteLine("Start npm install for hosthooks...");
70-
ProcessHelper.CmdExecute("npm install", hosthookDir);
71-
}
72-
7362
DeployEmbeddedElectronFiles.Do(tempPath);
7463

7564
var checkForNodeModulesDirPath = Path.Combine(tempPath, "node_modules");
@@ -86,8 +75,26 @@ public Task<bool> ExecuteAsync()
8675
Console.WriteLine("Skip npm install, because node_modules directory exists in: " + checkForNodeModulesDirPath);
8776
}
8877

78+
Console.WriteLine("ElectronHostHook handling started...");
79+
80+
string electronhosthookDir = Path.Combine(Directory.GetCurrentDirectory(), "ElectronHostHook");
81+
82+
if (Directory.Exists(electronhosthookDir))
83+
{
84+
string hosthookDir = Path.Combine(tempPath, "ElectronHostHook");
85+
DirectoryCopy.Do(electronhosthookDir, hosthookDir, true, new List<string>() { "node_modules" });
86+
87+
Console.WriteLine("Start npm install for hosthooks...");
88+
ProcessHelper.CmdExecute("npm install", hosthookDir);
89+
90+
string tscPath = Path.Combine(tempPath, "node_modules", ".bin");
91+
// ToDo: Not sure if this runs under linux/macos
92+
ProcessHelper.CmdExecute(@"tsc -p ../../ElectronHostHook", tscPath);
93+
}
94+
8995
string path = Path.Combine(tempPath, "node_modules", ".bin");
9096

97+
9198
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
9299
if (isWindows)
93100
{

0 commit comments

Comments
 (0)