diff --git a/.fontfoldercleanup/cleanup.py b/.fontfoldercleanup/cleanup.py index 3bfbb73..d3ea2cf 100644 --- a/.fontfoldercleanup/cleanup.py +++ b/.fontfoldercleanup/cleanup.py @@ -204,7 +204,14 @@ def unzip_if_no_fonts(root_path=font_location): os.system(f'unzip {zip_file_path} -d {dir_path}') print(f"Unzipped {zip_file_path}") - +def remove_setup_complete_files(root_path=font_location): + # walk through the root path directory and remove all files named ".setup_complete" + for root, dirs, files in os.walk(root_path): + for file in files: + if file == '.setup_complete': + file_path = os.path.join(root, file) + os.remove(file_path) + print(f"Removed .setup_complete file: {file_path}") if __name__ == '__main__': diff --git a/.fontfoldercleanup/remove_ds_and_clean_empty_folders.py b/.fontfoldercleanup/remove_ds_and_clean_empty_folders.py new file mode 100644 index 0000000..3128181 --- /dev/null +++ b/.fontfoldercleanup/remove_ds_and_clean_empty_folders.py @@ -0,0 +1,6 @@ +import cleanup + +if __name__ == '__main__': + cleanup.remove_ds_store_files() + cleanup.remove_setup_complete_files() + cleanup.remove_empty_folders()