Skip to content

Commit

Permalink
Allow single files as 'extra-data'
Browse files Browse the repository at this point in the history
Sometimes it is useful to add a single file as extra data instead of a
directory tree. As 'extra-data' already allows directories to be copied
to the output, it should also be used to copy single files.

Signed-off-by: Rafael Guterres Jeffman <[email protected]>
  • Loading branch information
rjeffman committed Feb 7, 2025
1 parent d788461 commit fa1a819
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ipalab_config/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,19 @@ def generate_ipalab_configuration():
if "extra_data" in data:
cwd = os.path.dirname(args.CONFIG)
for helper in data["extra_data"]:
if os.path.isabs(helper):
copy_helper_files(
base_dir,
os.path.basename(helper),
source=os.path.dirname(helper),
if os.path.isfile(helper):
copy_extra_files(
[helper], os.path.join(base_dir, os.path.dirname(helper))
)
else:
copy_helper_files(base_dir, helper, source=cwd)
if os.path.isabs(helper):
copy_helper_files(
base_dir,
os.path.basename(helper),
source=os.path.dirname(helper),
)
else:
copy_helper_files(base_dir, helper, source=cwd)


def main():
Expand Down

0 comments on commit fa1a819

Please sign in to comment.