Created
September 28, 2019 19:44
-
-
Save wgins/e123992d50c66be8f2c41f1a52f748ec to your computer and use it in GitHub Desktop.
yaml to json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create json dir and convert all .yaml files in current dir to json | |
# move all .json files into newly created json dir | |
mkdir json | |
for file in *.yaml | |
do | |
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < "$file" > "${file/.yaml/.json}" | |
mv *.json json/ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment