diff --git a/script/copy_firmware.py b/script/copy_firmware.py index 0b2cbb6..6d1d89d 100644 --- a/script/copy_firmware.py +++ b/script/copy_firmware.py @@ -11,13 +11,13 @@ def after_build(source, target, env): print( "Executing custom step " ) dir = env.GetLaunchDir() name = env.get( "PIOENV" ) - source = dir + "\\.pio\\build\\" + name + "\\firmware.bin" + source = dir + "/.pio/build/" + name + "/firmware.bin" if name == "gravity-debug" : - target = dir + "\\bin\\firmware-debug.bin" + target = dir + "/bin/firmware-debug.bin" if name == "gravity-release" : - target = dir + "\\bin\\firmware.bin" + target = dir + "/bin/firmware.bin" if name == "gravity-perf" : - target = dir + "\\bin\\firmware-perf.bin" + target = dir + "/bin/firmware-perf.bin" print( "Copy file : " + source + " -> " + target ) shutil.copyfile( source, target ) diff --git a/script/copy_html.py b/script/copy_html.py index c0fcc11..f5e8fb8 100644 --- a/script/copy_html.py +++ b/script/copy_html.py @@ -1,5 +1,5 @@ Import("env") -import shutil +import shutil, os print( "Executing custom step " ) dir = env.GetLaunchDir() @@ -7,6 +7,7 @@ source = dir + "/html/" target = dir + "/data/" print( "Copy html-files from " + source + " -> " + target ) +os.makedirs(os.path.dirname( target ), exist_ok=True) file = "about.min.htm" print( "Copy file: " + source + file + "->" + target + file) shutil.copyfile( source + file, target + file )