File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1212s_folder : Path = None
1313dirs : list = None
1414moddir : Path = None
15+ delete_mode : bool = False
1516
1617
1718def print_info (message ):
@@ -49,6 +50,10 @@ def Settings():
4950 exit ()
5051 else :
5152 cfg_path = Path ("./settings.json" )
53+
54+ global delete_mode
55+
56+ delete_mode = "-d" in argv
5257
5358
5459
@@ -145,6 +150,17 @@ def CheckDuplicates(folder):
145150 for fl in p_filelist : # We'll always iterate by the primary pathlist files
146151 if fl in s_filelist :
147152 print_info (f"[Duplicate] { fl } " )
153+
154+ if delete_mode :
155+ print_warning ("Are you sure you want to delete these files?" )
156+ input ("Press Ctrl+C or close the window to cancel, otherwise, proceeding to delete." )
157+ for fl in p_filelist :
158+ if fl in s_filelist :
159+ delpath : Path = s_path / fl
160+ print (f"[Deleting] { delpath } " )
161+ delpath .unlink (missing_ok = True )
162+
163+
148164
149165
150166def main ():
You can’t perform that action at this time.
0 commit comments