Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.29 KB

README.md

File metadata and controls

46 lines (34 loc) · 1.29 KB

yaml-tailor

CI Go Report Card

A tool for customizing YAML flies

Run

Usage:
  yaml-tailor [file] [flags]

Flags:
  -h, --help                 help for yaml-tailor
  -s, --string stringArray   a string override
  -v, --value stringArray    a value override

The application uses DJSON library syntax for interpreting string values and converting them to JSON objects and arrays. The same library is used for merging the interpreted values with elements of an existing YAML file.

The examples below demonstrate how an empty YAML file is populated with foo: bar element.

Run as a standalone app

Prerequisites:

$ go get github.com/moikot/yaml-tailor
$ echo '{}' > test.yml
$ yaml-tailor -v foo=bar test.yml
$ cat test.yml

Run as a Docker container

Prerequisites:

$ echo '{}' > test.yml
$ docker run -d --rm -v $(pwd):/yml moikot/yaml-tailor -v foo=bar /yml/test.yml
$ cat test.yml