From 08a2ad6effc2cce86ed564d4d752b159bf22fe29 Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Fri, 1 Jul 2022 18:16:17 +0200 Subject: [PATCH] Minor modifications --- automatic-file-deleter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/automatic-file-deleter.py b/automatic-file-deleter.py index c06d0b8..57bdf57 100644 --- a/automatic-file-deleter.py +++ b/automatic-file-deleter.py @@ -27,6 +27,8 @@ for file in relevant_files: if not fitting_file_exists: files_to_rm.append(file) +files_to_rm.sort() + directory_str_has_slash = directory[-1] == "/" if not directory_str_has_slash: directory += "/" @@ -36,4 +38,6 @@ for i in files_to_rm: print("You can run the following command to delete all the files:") print(rm_string) +with open("rm.sh", 'w') as f: + f.write(rm_string) print("This will delete the following files: " + str(files_to_rm))