Bug 1370936 - Ensure manifest directory exists before writing it, r=ato
MozReview-Commit-ID: H2o2CYAig1j
--- a/testing/web-platform/tests/tools/manifest/manifest.py
+++ b/testing/web-platform/tests/tools/manifest/manifest.py
@@ -232,11 +232,14 @@ def load(tests_root, manifest):
except IOError:
return None
return rv
return Manifest.from_json(tests_root, json.load(manifest))
def write(manifest, manifest_path):
+ dir_name = os.path.dirname(manifest_path)
+ if not os.path.exists(dir_name):
+ os.makedirs(dir_name)
with open(manifest_path, "wb") as f:
json.dump(manifest.to_json(), f, sort_keys=True, indent=1, separators=(',', ': '))
f.write("\n")