Documentation ¶
Overview ¶
Package patchtree is a simple library that knows how to interpret a folder structure of jd diffs and apply them on top of a base.
test/ base.json after_move/ modification.patch sanitization/ modification.patch hidden/ modification.patch nonempty/ modification.patch
Given a path relative ot the current binary, it walks backwards up the folder, ensuring that a modification.patch exists in each directory until it finds a base.json. Then it applies forward all of the modification.patches to give you the final composed json blob result.
patchtree-helper is a simple cli utility that wraps the functionality in this package.
Index ¶
Constants ¶
const BaseJSONName = "base.json"
BaseJSONName is the name of the base json file at the root of the directory tree.
const ExpandedJSONName = "node.expanded.json"
ExpandedJSONName is the name of the file that represents the entire expanded json blob at a given part of the tree, created by `expand`.
const PatchName = "modification.patch"
PatchName is the name of the patch in each sub-folder that modifies the json in the tree above it.
Variables ¶
This section is empty.
Functions ¶
func CleanTree ¶
CleanTree goes through each node, and if modification.json conceptually matches node.expanded.json, then removes node.expanded.json.
func ContractTree ¶
ContractTree goes through each node in the parse tree and where it finds a node.expanded,json, re-derives and overwrites the "modification.patch". Used as part of a workflow to modify base.json: run ExpandTree, modify base.json, then ContractTree.
func ExpandTree ¶
ExpandTree expands all of the nodes in the patchtree, applying the chains of modification and created an node.expanded.json in each node. Used in a workflow to modify base.json: run this commeand, then modify base.json, then run ContractTree.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
patchtree-helper
patchtree-helper is a simple command that wraps patchtree.ExpandTree and ContractTree.
|
patchtree-helper is a simple command that wraps patchtree.ExpandTree and ContractTree. |