mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-12-26 00:42:46 +00:00
dart: fix deletion logic to avoid deleting existing files
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
parent
a7f40c7813
commit
d03842d762
|
|
@ -141,7 +141,7 @@ def handle_pkg(
|
|||
if versions_dir.is_dir():
|
||||
for f in versions_dir.iterdir():
|
||||
if f.is_file() and f.suffix == ".gz":
|
||||
ver = f.stem
|
||||
ver = f.name.removesuffix(".tar.gz")
|
||||
if ver not in all_versions:
|
||||
logger.info(f"Removing obsolete pkg file {f.as_posix()}")
|
||||
f.unlink(missing_ok=True)
|
||||
|
|
|
|||
Loading…
Reference in New Issue