mirror of
https://github.com/ciromattia/kcc
synced 2026-09-01 00:17:05 +00:00
Create the destination dir before flattening a single-subfolder archive (#1405)
This commit is contained in:
@@ -984,6 +984,7 @@ def getWorkFolder(afile, workdir=None):
|
|||||||
else:
|
else:
|
||||||
workdir2 = mkdtemp('', 'KCC-')
|
workdir2 = mkdtemp('', 'KCC-')
|
||||||
fullPath2 = os.path.join(workdir2, 'OEBPS', 'Images')
|
fullPath2 = os.path.join(workdir2, 'OEBPS', 'Images')
|
||||||
|
os.makedirs(fullPath2, exist_ok=True)
|
||||||
for file in os.listdir(os.path.join(fullPath, tdir[0])):
|
for file in os.listdir(os.path.join(fullPath, tdir[0])):
|
||||||
move(os.path.join(fullPath, tdir[0], file), fullPath2)
|
move(os.path.join(fullPath, tdir[0], file), fullPath2)
|
||||||
rmtree(workdir, True)
|
rmtree(workdir, True)
|
||||||
|
|||||||
Reference in New Issue
Block a user