Link
The [[link]]
table defines a file or directory to be linked.
Key | Type | Default | Description |
---|---|---|---|
source | String | Required | Path to the source file or directory relative to the hermit.toml . |
target | String | Required | Path to the destination on the target system. Supports Handlebars and XDG variables. |
link | String | soft | The type of link to create. Possible values are soft , hard , copy . |
requires | Array of Strings | [] | A list of tags that must be active for this link to be processed. |
fallback | String | abort | What to do if the target already exists. See below for possible values. |
Fallback Operations
The fallback
key determines the behavior when a file or directory already exists at the target
location.
Value | Description |
---|---|
abort | (Default) Abort the apply command. |
backup | Move the existing file to a .bak file. If .bak already exists, create .bak.1 , etc. |
backupoverwrite | Move the existing file to a .bak file, overwriting .bak if it already exists. |
delete | Delete any existing file, but not directories. |
deletedir | Delete any existing file or directory. Use with caution. |
ignore | Do nothing if the file or directory already exists. |
Example
[[link]]
source = "fish/config.fish"
target = "~/.config/fish/config.fish"
fallback = "backupoverwrite"
requires = ["fish", "+os_family=unix"]