This script doesnt work for:
# parameters.yml
parameters:
database.name: app
$ yaml read parameters.yml parameters.database.name
null
I think this is valid yaml.
Am I missing something?
Ouch! No you're quite right, this won't handle dots in the name at the moment.
To fix this we'd need to add some escaping in the path name.
The following workaround works in current build FYI:
yaml r ~/parameters.yml parameters[database.name]
I think the approach show by @bubbleattic is probably the best approach. Otherwise I'm not sure how it would be possible to know if the intent by the user. The key lookup indicator [key] allows the user provide their intent and it will work regardless what format is used for any key.
If agreed, we can just update the docs accordingly.
Great find! I actually think that's better than escaping anyway :)
Most helpful comment
The following workaround works in current build FYI:
yaml r ~/parameters.yml parameters[database.name]