Fixed script to output the JSON and create doc directory.

This commit is contained in:
Jussi Räsänen 2016-03-28 16:19:05 +03:00
parent dbb5d11dd3
commit 8e2af4cf05

View file

@ -23,12 +23,17 @@ properties = dict(
) )
json_dump = json.dumps(properties, indent=4) json_dump = json.dumps(properties, indent=4)
print(json_dump)
# #
# Resolve path to doc directory and write CSS properties and JSON. # Resolve path to doc directory and write CSS properties and JSON.
# #
servo_doc_path = os.path.abspath(os.path.join(style, '../', '../', 'target', 'doc', 'servo')) servo_doc_path = os.path.abspath(os.path.join(style, '../', '../', 'target', 'doc', 'servo'))
# Ensure ./target/doc/servo exists
if not os.path.exists(servo_doc_path):
os.makedirs(servo_doc_path)
with open(os.path.join(servo_doc_path, 'css-properties.json'), "w") as out_file: with open(os.path.join(servo_doc_path, 'css-properties.json'), "w") as out_file:
out_file.write(json_dump) out_file.write(json_dump)