check if folder exists before trying to cleanup

This commit is contained in:
Nick Sweeting 2017-10-30 02:55:39 -05:00
parent 318b9ae1db
commit 965130815d

11
util.py
View file

@ -344,11 +344,12 @@ 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)])
files_in_source = set(os.listdir(source)) if os.path.exists(source):
if files_in_source: files_in_source = set(os.listdir(source))
manually_merge_folders(source, target) if files_in_source:
else: manually_merge_folders(source, target)
run(['rm', '-R', source]) else:
run(['rm', '-R', source])
def cleanup_archive(path, links): def cleanup_archive(path, links):