Patch
The [[patch]]
table defines a patch to be applied to a file. HermitGrab can parse TOML, YAML, and JSON (with comments) and apply the patch (which can also be in any of those formats). The type will be determined by the file extsion.
⚠️
Comments and formatting in the original target document will be lost during this process.
Key | Type | Default | Description |
---|---|---|---|
source | String | Required | Path to the patch file within the HermitGrab repository. |
target | String | Required | Path to the file to be patched on the target system. Supports Handlebars and XDG variables. |
type | String | Required | The patch method. See below for possible values. |
requires | Array of Strings | [] | A list of tags that must be active for this patch to be processed. |
order | Unsinged int | 0 | The order in which to execute this action. Patch actions with the same order number will be potentially be executed in parallel. |
Patch Types
Value | Description |
---|---|
JsonMerge | Apply patch according to RFC 7396. |
JsonPatch | Apply patch according to RFC 6902. |
Example
[[patch]]
source = "vscode/settings.json"
target = "~/.config/Code/User/settings.json"
type = "JsonMerge"
requires = ["vscode"]
[[patch]]
source = "config.toml"
target = "~/.cargo/config.toml"
type = "JsonMerge"