Skip to content

Commit

Permalink
Update to drop .j2 extension if used
Browse files Browse the repository at this point in the history
  • Loading branch information
trnubo committed Feb 9, 2016
1 parent 570ae33 commit 97d3742
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions voltgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ def render_files(self):
with tempfile.NamedTemporaryFile(mode='w', delete=False) as tmp_f:
tmp_f.write(self.render(f, self.context))
f_st = os.stat(f)
root, ext = os.path.splitext(f)
if ext == ".j2":
f = root
os.rename(tmp_f.name, f)
os.chmod(f, S_IMODE(f_st.st_mode))
os.chown(f, f_st.st_uid, f_st.st_gid)
Expand Down

0 comments on commit 97d3742

Please sign in to comment.