Open wilsonehusin opened 2 years ago
There is a problem with automatic adding / modifying bindl.yaml directly though: it removes any comments, which is an undesirable outcome.
Why would this happen? Can't the parsing just append after the last entry (and before any comments that are right before the next section)? Or is this something to do with YAML parser?
Can't the parsing just append after the last entry (and before any comments that are right before the next section)
That is assuming all bindl.yaml
starts with platforms
and ends with programs
— if the order were flipped, it would still be a valid bindl.yaml
and in that scenario, appending the last entry would go to platforms
block instead of programs
.
Understandable -- turns out YAML was not designed for programmatic editing, and I was naive to think that it's as simple as just finding programs
and adding an entry before the next top-level section. Turns out you can have variations on spacing (2 or 4 spaces) as well.
turns out YAML
Welcome to YAML engineering!
I'm starting to find myself getting tired of writing duplicates for
bindl.yaml
in different repositories. I think it might be time to add a convenience method ofbindl add
to add commonly used programs.For example, I use
ko
a lot and I would like to run something like the following to append the program tobindl.yaml
.There is a problem with automatic adding / modifying
bindl.yaml
directly though: it removes any comments, which is an undesirable outcome.One way we can do this is to use something like
bindl.d/ko.yaml
and havebindl sync
read all ofbindl.d
.