Add the template option documentation.

This commit is contained in:
Bauke 2022-11-04 19:19:14 +01:00
parent 8d1baaf57f
commit a4d0431a32
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 7 additions and 0 deletions

View File

@ -20,3 +20,7 @@ Below is the default script template that Hooked uses, where `hook_type` is the
```sh
{{#include ../../../hooked-cli/source/templates/default.sh}}
```
You can provide your own template by using the `general.template` configuration setting. If you do, make sure you include a line somewhere that says `# Installed by Hooked.` for the [uninstall CLI command][cli-uninstall].
[cli-uninstall]: ./uninstall.md

View File

@ -10,11 +10,13 @@ The `general` [table][toml-table] is for main Hooked configuration.
|-----|------|---------|-------------|
| config | String | Hooked.toml | The configuration file to use. If your configuration file isn't `Hooked.toml` you should set this accordingly. |
| directory | String | hooks | The directory Hooked looks in for anything related to files. For example: scripts, templates, etc. |
| template | Optional string | | Path to a custom template to be used when installing scripts. See the [install CLI command][cli-install] for more details. |
```toml
[general]
config = "Hooked.toml"
directory = "hooks"
template = "template.sh"
```
## Pre-commit
@ -43,5 +45,6 @@ on_failure = "continue"
[^command-and-script]: When both a command and script are defined in a hook, *only* the command will be run.
[cli-install]: ../cli/install.md
[toml-table]: https://toml.io/en/v1.0.0#table
[toml-arrays-of-tables]: https://toml.io/en/v1.0.0#array-of-tables