prevent crash when no firmware exits

This commit is contained in:
Jason2866 2023-03-21 17:26:22 +01:00 committed by GitHub
parent 985149c934
commit 4fd6694efc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ if "nobuild" in COMMAND_LINE_TARGETS:
source_firm = join(env.subst("$PROJECT_DIR"), "build_output","firmware",firm_name)
if not os.path.exists(join(env.subst("$BUILD_DIR"))):
os.makedirs(join(env.subst("$BUILD_DIR")))
if os.path.isfile(source_firm):
shutil.copy(source_firm, join(env.subst("$BUILD_DIR")))
target_ren = join(env.subst("$BUILD_DIR"), firm_name)
renamed = join(env.subst("$BUILD_DIR"), "firmware.bin")