qyt [options] <yq_expression> <file_regexp>
See yq docs for query syntax.
qyt query '.name' '*.yml'
qyt query '{"b": $branch, "fp": $filename, "keys": keys}' '*.yml'
You can update files in each branch by configuring a commit message. qyu writes the result of the query to the source file and adds all the modified files to a commit.
The commit message is executed as a template with a populated "CommitMessageData" data structure.
type CommitMessageData struct {
Branch string
Query string
}
For example when you run the following command (with branches main, and rel/2.0)
qyt apply -m 'run {{printf "%q" .Query}} on {{.Branch}}' 'del(.name)' data.yml
The commit messages will look like
run "del(.name)" on main
and
run "del(.name)" on rel/2.0
See text/templates for template syntax.