Add files via upload

This commit is contained in:
Jason2866 2019-11-16 13:57:07 +01:00 committed by GitHub
parent 72f901a2f7
commit 94bd75681e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

12
pio/name-firmware.py Normal file
View File

@ -0,0 +1,12 @@
Import('env')
import os
import shutil
def name_firmware(source, target, env):
base_dir = os.path.dirname(str(target[0]))
new_file = "{}{}{}.bin".format(base_dir, os.path.sep, str(target[0]).split(os.path.sep)[1])
if os.path.isfile(new_file):
os.remove(new_file)
shutil.copyfile(str(target[0]), new_file)
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [name_firmware])