Merge pull request #3742 from maxpareschi/3.14.1-22dogs.1

enhancement/workfile template also matches against os.environ
This commit is contained in:
Jakub Trllo 2022-08-29 11:27:54 +02:00 committed by GitHub
commit ce3d0094a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -419,9 +419,14 @@ def get_custom_workfile_template(
# when path is available try to format it in case
# there are some anatomy template strings
if matching_item:
# extend anatomy context with os.environ to
# also allow formatting against env
full_context_data = os.environ.copy()
full_context_data.update(anatomy_context_data)
template = matching_item["path"][platform.system().lower()]
return StringTemplate.format_strict_template(
template, anatomy_context_data
template, full_context_data
).normalized()
return None