Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jasperes/bash-yaml
Read a yaml file and create variables in bash
https://github.com/jasperes/bash-yaml
bash bash-script bash-yaml yaml yaml-bash yaml-parser
Last synced: 1 day ago
JSON representation
Read a yaml file and create variables in bash
- Host: GitHub
- URL: https://github.com/jasperes/bash-yaml
- Owner: jasperes
- License: mit
- Created: 2017-08-10T03:30:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-13T07:23:05.000Z (over 1 year ago)
- Last Synced: 2024-12-14T22:03:44.735Z (8 days ago)
- Topics: bash, bash-script, bash-yaml, yaml, yaml-bash, yaml-parser
- Language: Shell
- Homepage:
- Size: 60.5 KB
- Stars: 367
- Watchers: 15
- Forks: 122
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bash-yaml
[![Tests](https://github.com/jasperes/bash-yaml/workflows/Tests/badge.svg)](https://github.com/jasperes/bash-yaml/actions?query=workflow%3ATests)
[![Lint](https://github.com/jasperes/bash-yaml/workflows/Lint/badge.svg)](https://github.com/jasperes/bash-yaml/actions?query=workflow%3ALint)Bash script to read a Yaml file and create variables.
## Working on
- Linux
- OSX## Getting Started
### Usage
Copy the `script/yaml.sh` file and import on your script: `source yaml.sh`
Then two functions are viable:
- **parse_yaml**: Output result from the readed yaml file.
- **create_variables**: Read and create variables based on yaml file passed by argument.Look at `test` folder to see more.
### Testing
You can test if your yaml file will be readed correctly based on test folder.
## Known issues
- Object lists must be informed all attributes. Null must be "attr: ".
## Credits
This project was started based on @pkuczynski gist. Found it [here](https://gist.github.com/pkuczynski/8665367)