create path when parent of file to be written does not exist
+ usage for frappy command
This commit is contained in:
@@ -312,6 +312,7 @@ def write_when_new(filename, content, as_root=False, ignore_reduction=False):
|
||||
return False
|
||||
if doit:
|
||||
if lines:
|
||||
Path(filename).parent.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.NamedTemporaryFile('w') as fil:
|
||||
fil.write(content)
|
||||
fil.flush()
|
||||
|
||||
Reference in New Issue
Block a user