Skip to content

Commit 6fc79c1

Browse files
committed
skip npm install when modules dir exists
for #10
1 parent 64dd5d6 commit 6fc79c1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ElectronNET.CLI/Commands/StartElectronCommand.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,19 @@ public Task<bool> ExecuteAsync()
5555

5656
DeployEmbeddedElectronFiles.Do(tempPath);
5757

58-
Console.WriteLine("Start npm install...");
59-
ProcessHelper.CmdExecute("npm install", tempPath);
58+
var checkForNodeModulesDirPath = Path.Combine(tempPath, "node_modules");
59+
60+
if (Directory.Exists(checkForNodeModulesDirPath) == false)
61+
{
62+
Console.WriteLine("node_modules missing in: " + checkForNodeModulesDirPath);
63+
64+
Console.WriteLine("Start npm install...");
65+
ProcessHelper.CmdExecute("npm install", tempPath);
66+
}
67+
else
68+
{
69+
Console.WriteLine("Skip npm install, because node_modules directory exists in: " + checkForNodeModulesDirPath);
70+
}
6071

6172
string path = Path.Combine(tempPath, "node_modules", ".bin");
6273

0 commit comments

Comments
 (0)