Skip to content

Commit

Permalink
Fix #5911: WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
git-user committed Jul 21, 2023
1 parent 04c62eb commit 656d83c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sirepo/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ def render(*paths, target_dir=None, j2_ctx=None):
Returns:
py.path: path to rendered file
"""

def _with_jinja_suffix(paths):
return paths[:-1] + tuple([paths[-1] + pykern.pkjinja.RESOURCE_SUFFIX])

res = target_dir.join(paths[-1])
p = list(paths)
p[-1] += pykern.pkjinja.RESOURCE_SUFFIX
pykern.pkjinja.render_file(
file_path(*p),
file_path(*_with_jinja_suffix(paths)),
j2_ctx,
output=res,
)
Expand Down

0 comments on commit 656d83c

Please sign in to comment.