Skip to content

Commit

Permalink
Use of os.remove and shutil.copy2 to fix Windows target
Browse files Browse the repository at this point in the history
  • Loading branch information
gogoprog committed Oct 19, 2017
1 parent 8e1d260 commit 2ba4c78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand Down
6 changes: 5 additions & 1 deletion scripts/gengine-run
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import common
import emscripten
import shutil

def run():
if not common.html5Mode:
Expand All @@ -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)

Expand Down

0 comments on commit 2ba4c78

Please sign in to comment.