Skip to content

Commit

Permalink
Added NodeJS Engine (#665)
Browse files Browse the repository at this point in the history
* Added NodeJS engine

* only use exe on windows and if node
  • Loading branch information
Daniel-Genkin authored Jun 30, 2021
1 parent 567bf8f commit 6d17e5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,9 @@ internal enum JavaScriptEngine
/// SpiderMonkey
/// </summary>
SpiderMonkey,
/// <summary>
/// NodeJS
/// </summary>
NodeJS,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ protected override async Task<ExitCode> InvokeInternal(ILogger logger)
JavaScriptEngine.V8 => "v8",
JavaScriptEngine.JavaScriptCore => "jsc",
JavaScriptEngine.SpiderMonkey => "sm",
JavaScriptEngine.NodeJS => "node",
_ => throw new ArgumentException("Engine not set")
};

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
engineBinary = FindEngineInPath(engineBinary + ".cmd");
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
if (engineBinary.Equals("node"))
engineBinary = FindEngineInPath(engineBinary + ".exe"); // NodeJS ships as .exe rather than .cmd

else
engineBinary = FindEngineInPath(engineBinary + ".cmd");
}

var webServerCts = new CancellationTokenSource();
try
Expand Down

0 comments on commit 6d17e5b

Please sign in to comment.