mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 22:54:27 -04:00
check if folder exists before trying to cleanup
This commit is contained in:
parent
318b9ae1db
commit
965130815d
1 changed files with 6 additions and 5 deletions
1
util.py
1
util.py
|
@ -344,6 +344,7 @@ def merge_folders(path, folder, link):
|
||||||
for file in files_in_source:
|
for file in files_in_source:
|
||||||
run(['mv', os.path.join(source, file), os.path.join(target, file)])
|
run(['mv', os.path.join(source, file), os.path.join(target, file)])
|
||||||
|
|
||||||
|
if os.path.exists(source):
|
||||||
files_in_source = set(os.listdir(source))
|
files_in_source = set(os.listdir(source))
|
||||||
if files_in_source:
|
if files_in_source:
|
||||||
manually_merge_folders(source, target)
|
manually_merge_folders(source, target)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue