Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binary files to be copied into the build context #250

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/rocker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ def write_files(extensions, args_dict, target_directory):
'and cannot be written out, skipping' % (file_path, active_extension.get_name()))
continue
Path(os.path.dirname(full_path)).mkdir(exist_ok=True, parents=True)
with open(full_path, 'w') as fh:
mode = 'wb' if isinstance(contents, bytes) else 'w' # check to see if contents should be written as binary
with open(full_path, mode) as fh:
print('Writing to file %s' % full_path)
fh.write(contents)
return all_files
Expand Down