Skip to content

ash-shell/yaml-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yaml-Parse

Build Status

Yaml-Parse is an Ash module that offers YAML parsing in Bash.

Getting started

Yaml-Parse is part of the Ash core, so you can just start using it in your Ash modules.

Example Usage

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

Running Tests

Tests are written using the official test module

You can run tests by running this command, after Yaml-Parse is installed:

ash test yamlparse

Credits

All of the heavy lifting was done by Stefan Farestam in response to this StackOverflow Post. This is simply an Ash wrapper.

License

MIT