Adding function to remove .setup_complete files.

This commit is contained in:
Matt Troutman 2024-10-02 13:33:08 -05:00
parent bccb822eca
commit b2beb5765b
No known key found for this signature in database
2 changed files with 14 additions and 1 deletions

View file

@ -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__':

View file

@ -0,0 +1,6 @@
import cleanup
if __name__ == '__main__':
cleanup.remove_ds_store_files()
cleanup.remove_setup_complete_files()
cleanup.remove_empty_folders()