remove .DS_Store if its the only file left
This commit is contained in:
parent
5110410eda
commit
6692e9f3a8
1 changed files with 3 additions and 0 deletions
|
@ -315,6 +315,9 @@ def update_dict(root, data):
|
||||||
def remove_empty_folders(prefix):
|
def remove_empty_folders(prefix):
|
||||||
empty = []
|
empty = []
|
||||||
for root, folders, files in os.walk(prefix):
|
for root, folders, files in os.walk(prefix):
|
||||||
|
if len(files) == 1 and files[0] == '.DS_Store':
|
||||||
|
os.unlink(os.path.join(root, files[0]))
|
||||||
|
files = []
|
||||||
if not folders and not files:
|
if not folders and not files:
|
||||||
empty.append(root)
|
empty.append(root)
|
||||||
for folder in empty:
|
for folder in empty:
|
||||||
|
|
Loading…
Reference in a new issue