Skip to content

Commit

Permalink
Fix error with no dest path in inject
Browse files Browse the repository at this point in the history
  • Loading branch information
saville committed Nov 8, 2023
1 parent 0c26767 commit 12fe87c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion buildrunner/steprunner/tasks/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def __init__(
)

for src_glob, dest_path in self.config.get('inject', {}).items():
if not dest_path:
dest_path = ''
_src_glob = self.step_runner.build_runner.global_config.to_abs_path(src_glob)
xsglob = glob.glob(_src_glob)
if not xsglob:
Expand All @@ -102,7 +104,7 @@ def __init__(
# Only one source - destination may be directory or filename - check for a trailing
# '/' and treat it accordingly.
source_file = xsglob[0]
if dest_path[-1] == '/' or os.path.split(dest_path)[-1] in ('.', '..'):
if dest_path and (dest_path[-1] == '/' or os.path.split(dest_path)[-1] in ('.', '..')):
self.to_inject[source_file] = os.path.normpath(
os.path.join(
'.',
Expand Down

0 comments on commit 12fe87c

Please sign in to comment.