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.
This commit is contained in:
24
Cargo.lock
generated
24
Cargo.lock
generated
@@ -44,6 +44,15 @@ version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "blake2"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
||||
dependencies = [
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.4"
|
||||
@@ -209,6 +218,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
dependencies = [
|
||||
"block-buffer",
|
||||
"crypto-common",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -776,6 +786,12 @@ dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380"
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "0.3.11"
|
||||
@@ -820,6 +836,12 @@ dependencies = [
|
||||
"syn 2.0.48",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
@@ -899,10 +921,12 @@ name = "tmpl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"argparse",
|
||||
"blake2",
|
||||
"file-mode",
|
||||
"pwd-grp",
|
||||
"serde",
|
||||
"serde_yaml",
|
||||
"shlex",
|
||||
"tera",
|
||||
"thiserror",
|
||||
"tracing",
|
||||
|
||||
Reference in New Issue
Block a user