From 12fe87cabae51e226793efc7ab72e0eb22d03242 Mon Sep 17 00:00:00 2001 From: saville Date: Wed, 8 Nov 2023 16:05:24 -0700 Subject: [PATCH] Fix error with no dest path in inject --- buildrunner/steprunner/tasks/build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildrunner/steprunner/tasks/build.py b/buildrunner/steprunner/tasks/build.py index de695f57..ab469032 100644 --- a/buildrunner/steprunner/tasks/build.py +++ b/buildrunner/steprunner/tasks/build.py @@ -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: @@ -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( '.',