Skip to content

6. Miscellaneous features

SuperCuber edited this page May 24, 2025 · 1 revision

Watch

Running dotter watch will make it run continuously and wait for changes in the repository, deploying when they happen.
This is helpful to mitigate the disadvantage of templates - it will update them instantly when you modify them, making them "feel" like symlinks while it runs (at least in the source → target direction).

Hooks

Dotter supports hooks - files which are executed when a certain action happens. Currently supported:

  • Before a deploy, at .dotter/pre_deploy.sh
  • After a deploy, at .dotter/post_deploy.sh
  • Before an undeploy, at .dotter/pre_undeploy.sh
  • After an undeploy, at .dotter/post_undeploy.sh

Note that these files are rendered as a template, which means they can use all of the logic and variables that a regular templated file can.
Use this for example with the dotter.packages variable to turn on/off sections of such a script.

On linux, the template is cached in .dotter/cache/.dotter/pre_deploy.sh, and the rendered contents are piped into sh.
On windows, the file is rendered to .dotter/cache/.dotter/pre_deploy.bat and then executed directly.

Hostname local.toml

If local.toml file is not found, Dotter will look for a file named <hostname>.toml using the machine's hostname. If you're not sure what file this is looking for, then:

  • Make sure there is no local.toml
  • Run dotter -v
  • Look for the message saying local.toml not found, using SOMETHING.toml instead (based on hostname)

Manual patch

When using the -p/--patch flag, standard input will be taken as an additional step on top of local.toml's [files] and [variables] - use this for ad-hoc modifications to the configuration, for example

dotter -p <<<"variables.font_size = 20"

This is using bash's here-string. Other shells have similar features allowing this as well (see also heredoc)

Clone this wiki locally