Fix tmp cleaning

This commit is contained in:
Jordan ERNST 2022-04-27 18:24:25 +02:00
parent 9c090991c0
commit 0e3d6c171e
1 changed files with 5 additions and 1 deletions

View File

@ -380,7 +380,11 @@ if __name__ == '__main__':
is_empty = not any(tmp.iterdir())
if not is_empty:
if yes_or_no("The folder 'files/tmp' is not empty. Would you like to remove the content ?", default="no"):
rmtree(tmp)
for p in tmp.iterdir():
if p.is_dir():
rmtree(p)
else:
p.unlink()
print('Choose a service to start a listener:')
menu_options = {