Yaml-Parse is an Ash module that offers YAML parsing in Bash.
Yaml-Parse is part of the Ash core, so you can just start using it in your Ash modules.
Our YAML file:
name: "Brandon Romano"
location: "Brooklyn, NYC"
Here's some example usage:
eval $(YamlParse__parse "./path/to/file.yaml" "Config_")
echo "$Config_name"
echo "$Config_location"
Outputs:
Brandon Romano
Brooklyn, NYC
Tests are written using the official test module
You can run tests by running this command, after Yaml-Parse is installed:
ash test yamlparse
All of the heavy lifting was done by Stefan Farestam in response to this StackOverflow Post. This is simply an Ash wrapper.