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). Note that 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.

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"]