Skip to content

Commit

Permalink
Properly handle file names specified as binary data
Browse files Browse the repository at this point in the history
Resolve #604
  • Loading branch information
valeros committed Aug 16, 2021
1 parent 8e52bea commit bec7ade
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions builder/frameworks/_embed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,10 @@


def extract_files(cppdefines, files_type):
files = []
if "build." + files_type in board:
files.extend(
[
join("$PROJECT_DIR", f)
for f in board.get("build." + files_type, "").split()
if f
]
)
result = []
files = env.GetProjectOption("board_build.%s" % files_type, "").splitlines()
if files:
result.extend([join("$PROJECT_DIR", f.strip()) for f in files if f])
else:
files_define = "COMPONENT_" + files_type.upper()
for define in cppdefines:
Expand All @@ -58,13 +53,13 @@ def extract_files(cppdefines, files_type):
for f in value.split(":"):
if not f:
continue
files.append(join("$PROJECT_DIR", f))
result.append(join("$PROJECT_DIR", f))

for f in files:
for f in result:
if not isfile(env.subst(f)):
print('Warning! Could not find file "%s"' % basename(f))

return files
return result


def remove_config_define(cppdefines, files_type):
Expand Down

0 comments on commit bec7ade

Please sign in to comment.