aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pomu/package.py')
-rw-r--r--pomu/package.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pomu/package.py b/pomu/package.py
index e0714dd..2651774 100644
--- a/pomu/package.py
+++ b/pomu/package.py
@@ -81,11 +81,15 @@ class Package():
def merge_into(self, dst):
"""Merges contents of the package into a specified directory (dst)"""
for trg, src in self.filemap.items():
- wd, _ = path.split(trg)
+ wd, filename = path.split(trg)
dest = path.join(dst, wd)
try:
makedirs(dest, exist_ok=True)
- copy2(src, dest)
+ if isinstance(src, bytes):
+ with open(path.join(dest, filename), 'wb') as f:
+ f.write(src)
+ else:
+ copy2(src, dest)
except PermissionError:
return Result.Err('You do not have enough permissions')
return Result.Ok().and_(self.apply_patches())