BashscripttoreadaYamlfileandcreatevariables.
WorkingonLinuxOSXGettingStartedUsageCopythescript/yaml.shfileandimportonyourscript:sourceyaml.sh
Thentwofunctionsareviable:
parse_yaml:Outputresultfromthereadedyamlfile.create_variables:Readandcreatevariablesbasedonyamlfilepassedbyargument.Lookattestfoldertoseemore.
TestingYoucantestifyouryamlfilewillbereadedcorrectlybasedontestfolder.
KnownissuesObjectlistsmustbeinformedallattributes.Nullmustbe"attr:".CreditsThisprojectwasstartedbasedon@pkuczynskigist.Foundithere
评论