diff --git a/scripts/common.py b/scripts/common.py index 1a67b39..cf17dd4 100755 --- a/scripts/common.py +++ b/scripts/common.py @@ -180,7 +180,10 @@ def compile(): if skipHaxe: return - os.system("rm -rf " + targetDir + "generated/main.js") + try: + os.remove(targetDir + "generated/main.js") + except OSError: + pass if not os.path.exists(targetDir + "/build.hxml"): log("Compiling : Running haxe default command line...") diff --git a/scripts/gengine-run b/scripts/gengine-run index 2cdb35e..1542992 100755 --- a/scripts/gengine-run +++ b/scripts/gengine-run @@ -3,6 +3,7 @@ import os import common import emscripten +import shutil def run(): if not common.html5Mode: @@ -17,7 +18,10 @@ def run(): emscripten.build(common.targetDir, common.targetDir) else: os.chdir(common.targetDir) - os.system("cp -f " + common.rootPath + "/build/index.* .") + shutil.copy2(common.rootPath + "/build/index.html", ".") + shutil.copy2(common.rootPath + "/build/index.js", ".") + shutil.copy2(common.rootPath + "/build/index.html.mem", ".") + shutil.copy2(common.rootPath + "/build/index.data", ".") emscripten.runServer(common.targetDir)