Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 611bbbc4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Create parent directories before writing to output target files" into main

parents 492eea80 cc758d96
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3238,7 +3238,9 @@ class File(object):
    return t

  def WriteToDir(self, d):
    with open(os.path.join(d, self.name), "wb") as fp:
    output_path = os.path.join(d, self.name)
    os.makedirs(os.path.dirname(output_path), exist_ok=True)
    with open(output_path, "wb") as fp:
      fp.write(self.data)

  def AddToZip(self, z, compression=None):