Add -npx flag for lime test electron to run the npx electron command instead of just electron.
This will prompt the user to install electron, if required. Saves a separate `npm install -g electron` command before testing.
This commit is contained in:
@@ -5,10 +5,15 @@ import lime.tools.HXProject;
|
||||
|
||||
class ElectronHelper
|
||||
{
|
||||
public static function launch(project:HXProject, path:String):Void
|
||||
public static function launch(project:HXProject, path:String, ?npx:Bool):Void
|
||||
{
|
||||
var electronPath = project.defines.get("ELECTRON_PATH");
|
||||
if (npx)
|
||||
{
|
||||
System.runCommand("", "npx", ["electron", path]);
|
||||
return;
|
||||
}
|
||||
|
||||
var electronPath = project.defines.get("ELECTRON_PATH");
|
||||
if (electronPath == null || electronPath == "")
|
||||
{
|
||||
electronPath = "electron";
|
||||
|
||||
@@ -263,7 +263,8 @@ class HTML5Platform extends PlatformTarget
|
||||
}
|
||||
else if (targetFlags.exists("electron"))
|
||||
{
|
||||
ElectronHelper.launch(project, targetDirectory + "/bin");
|
||||
var npx = targetFlags.exists("npx");
|
||||
ElectronHelper.launch(project, targetDirectory + "/bin", npx);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user