From 8f022dbe48e0c4ffa054c81d5505ca6ec7f74910 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 5 Oct 2023 15:21:14 +0200 Subject: [PATCH] test removing --- commands/tinfoil.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/commands/tinfoil.py b/commands/tinfoil.py index d898f82..4f6b53f 100755 --- a/commands/tinfoil.py +++ b/commands/tinfoil.py @@ -48,6 +48,13 @@ def remove(path, file): os.remove(os.path.join(path, file)) +def clean(path, database): + for file in os.listdir(path): + if os.path.isfile(os.path.join(path, file)) and file not in database: + # remove(path, file) + print(f"Hop {path}/{file}") + + req_titles = requests.get( "https://raw.githubusercontent.com/blawar/titledb/master/FR.fr.json" ) @@ -79,6 +86,11 @@ def get_title_shortid(name): return id[0:-4] if id in titles else None +clean("nsz/base", bases) +clean("nsz/dlc", dlcs) +clean("nsz/updates", updates) + + try: subprocess.run( ["rclone", "sync", "-P", "-v", f"{remote}:nsz/homebrew", "nsz/homebrew/"],