Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (15 sloc) 404 Bytes
#!/usr/bin/env python
import json
import sys
import yaml
def main():
if len(sys.argv) == 1:
print 'Must pass a list of yaml files'
sys.exit(1)
for f in sys.argv[1:]:
contents = yaml.load(file(f))
json_path = f.replace('.yaml', '.json')
with file(json_path, 'w+') as fd:
fd.write(json.dumps(contents))
if __name__ == '__main__':
main()