herrjulz / aviator

Merge YAML/JSON files in a in a convenient fashion based on a configuration file called aviator.yml
MIT License
60 stars 7 forks source link

[feature request] New merge type that doesn't require a file #38

Open gdankov opened 5 years ago

gdankov commented 5 years ago

Hey Julz,

The suggestion here is to perform a standard merge, but instead of having to always specify files in the with section, we can directly write the yaml code we would like to merge.

For example, let's say we have the following aviator file:

spruce:
- base: path/to/base.yml
  merge:
  - with_obj:
    foo:
      bar: 42
      baz: true
  to: result.yml

That would merge the base file with the following:

foo:
  bar: 42
  baz: true

Why? Sometimes you want to merge something really tiny (2-3 lines) and creating a separate file for that can be an overkill.

Thanks 🙂