Skip to content

Commit bb242d9

Browse files
committed
mkdir parent when writing
1 parent dcb64ac commit bb242d9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/mkbuildoptglobals.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ def write_or_replace(p: pathlib.Path, contents: str, encoding=FILE_ENCODING) ->
393393
logging.warning("cannot decode %s", p.name)
394394

395395
if contents != actual:
396+
p.parent.mkdir(parents=True, exist_ok=True)
396397
p.write_text(contents, encoding=encoding)
397398
logging.debug("%s contents written", p.name)
398399
return True

0 commit comments

Comments
 (0)