mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-12-25 16:32:47 +00:00
github-release: suppress warnings printed when removing empty directories [ci skip]
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
parent
501553bf55
commit
870eefd7b6
|
|
@ -292,14 +292,13 @@ def main():
|
||||||
old_file.unlink()
|
old_file.unlink()
|
||||||
|
|
||||||
for local_dir in working_dir.glob("*/*/*"):
|
for local_dir in working_dir.glob("*/*/*"):
|
||||||
|
# remove empty dirs only
|
||||||
if local_dir.is_dir():
|
if local_dir.is_dir():
|
||||||
try:
|
try:
|
||||||
# remove empty dirs only
|
|
||||||
local_dir.rmdir()
|
local_dir.rmdir()
|
||||||
except Exception as e:
|
logger.info(f"Removing empty directory {local_dir}")
|
||||||
logger.warning(
|
except Exception:
|
||||||
f"Failed to remove directory {local_dir}: {e}", exc_info=True
|
pass
|
||||||
)
|
|
||||||
|
|
||||||
logger.info(f"Total size is {sizeof_fmt(total_size, suffix='')}")
|
logger.info(f"Total size is {sizeof_fmt(total_size, suffix='')}")
|
||||||
if not all_success:
|
if not all_success:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue