Skip to content

Commit 1176821

Browse files
committed
Allow pythonServer to specify script name
1 parent 28515f3 commit 1176821

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/nme/src/platforms/EmscriptenPlatform.hx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ class EmscriptenPlatform extends DesktopPlatform
213213
{
214214
if (project.hasDef("pythonServe"))
215215
{
216-
runPython(arguments);
216+
var server = "" + project.getDef("pythonServe");
217+
if (server.endsWith(".py"))
218+
runPython(server,arguments);
219+
else
220+
runPython(arguments);
217221
}
218222
else
219223
{
@@ -242,9 +246,9 @@ class EmscriptenPlatform extends DesktopPlatform
242246
}
243247

244248

245-
public function runPython(arguments:Array<String>):Void
249+
public function runPython(?pythonFile:String, arguments:Array<String>):Void
246250
{
247-
var command = sdkPath==null ? [ "-m", "http.server" ] : [sdkPath + "/upstream/emscripten/emrun.py"];
251+
var command = pythonFile!=null ? [pythonFile] : sdkPath==null ? [ "-m", "http.server" ] : [sdkPath + "/upstream/emscripten/emrun.py"];
248252
var source = "index.html";
249253
//var source = ext == ".html" ? Path.withoutDirectory(executablePath) : "index.html";
250254
var browser = CommandLineTools.browser;

0 commit comments

Comments
 (0)