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.
KeyTypeDefaultDescription
sourceStringRequiredPath to the patch file within the HermitGrab repository.
targetStringRequiredPath to the file to be patched on the target system. Supports Handlebars and XDG variables.
typeStringRequiredThe patch method. See below for possible values.
requiresArray of Strings[]A list of tags that must be active for this patch to be processed.
orderUnsinged int0The order in which to execute this action. Patch actions with the same order number will be potentially be executed in parallel.

Patch Types

ValueDescription
JsonMergeApply patch according to RFC 7396.
JsonPatchApply 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"