Commit 5a16e17e authored by Alexandros Frantzis's avatar Alexandros Frantzis

scripts: Ensure dump_trace_images log files can be created

Ensure the directory the log file is placed in exists.
Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
parent 6324102b
......@@ -40,7 +40,8 @@ def run_logged_command(cmd, log_path):
ret = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
logoutput = ("[dump_images] Running: %s\n" % " ".join(cmd)).encode() + \
ret.stdout
with open(str(log_path), 'wb') as log:
log_path.parent.mkdir(parents=True, exist_ok=True)
with log_path.open(mode='wb') as log:
log.write(logoutput)
if ret.returncode:
sys.stdout.buffer.write(logoutput)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment