Commit Graph

4 Commits

Author SHA1 Message Date
1099fa40c7 write_file: Do not overwrite with same content
The `write_file` function will no longer overwrite existing files if the
content has not changed.  This will ensure file metadata timestamps are
accurate, and reduce unnecessary filesystem activity.
2024-01-18 19:46:25 -06:00
6d0bfeedaf Add post-change hooks feature
After rendering a template, `tmpl` will now run any commands specified
in the `hooks` property of a template instruction.  Hooks can either be
"immediate," meaning they will run as soon as the new file is written,
or "deferred," and will run after all templates have been rendered.
Deferred hooks are deduplicated: if multiple templates specify the
exact same command, it will only be run once.  Hook commands can include
the `%s` placeholder, which will be replaced by the path of the rendered
file.
2024-01-11 22:27:59 -06:00
47d138a9c6 Render templates to file and set permissions 2024-01-11 13:36:39 -06:00
bc1d8b187c Initial commit 2024-01-11 08:23:48 -06:00