From 2ba4c789fe79e7396795fbbcbe391959dec290a4 Mon Sep 17 00:00:00 2001 From: Gauthier Billot Date: Thu, 19 Oct 2017 20:41:24 +0200 Subject: [PATCH] Use of os.remove and shutil.copy2 to fix Windows target --- scripts/common.py | 5 ++++- scripts/gengine-run | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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)