Created
June 27, 2016 05:52
-
-
Save perduta/53e5cbee43ff5b370bd5c0752e955175 to your computer and use it in GitHub Desktop.
This file contains 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
import os | |
import os.path | |
import json | |
with open('json') as f: | |
data = json.load(f) | |
if not os.path.exists(data['branch']): | |
os.mkdir(data['branch']) | |
for module_name, code in data['modules'].items(): | |
path = os.path.join(data['branch'], '{}.js'.format(module_name)) | |
with open(path, 'w') as f: | |
f.write(code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment