Created
September 26, 2016 16:50
-
-
Save anonymous/836193b4ad82c5a33e1f77088dc23ac2 to your computer and use it in GitHub Desktop.
JSON to YAML converter.
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
#!/bin/sh | |
JFILE=$1 | |
python -c 'import sys, yaml, json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < $JFILE | |
## usage | |
## $ py2j.sh my-cloudformation-template.json > my-cloudformation-template.yaml | |
## see also py2j.sh: | |
## #!/bin/sh | |
## | |
## YFILE=$1 | |
## | |
## python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout)' < $YFILE |jq '.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment