cleanup after itself.

This commit is contained in:
Matt Troutman 2024-10-02 13:52:17 -05:00
parent 522f6154d0
commit 689ed19245
No known key found for this signature in database
2 changed files with 16 additions and 1 deletions

View file

@ -6,6 +6,7 @@ font_location = '/Users/fishy/custom_fonts/font_files'
bad_phrases = [' Free',
'-medium',
'-Medium',
'_3',
' by jeremy vessey',
' teenage foundry',
@ -241,6 +242,16 @@ def prepend_folder_name_to_font_dash(root_path=font_location):
os.rename(dir_path, new_dir_path)
print(f"Renamed directory: {dir_path} -> {new_dir_path}")
def lowercase_file_names(root_path=font_location):
for root, dirs, files in os.walk(root_path):
for file in files:
file_path = os.path.join(root, file)
new_file_path = os.path.join(root, file.lower())
#let's also remove spaces in the file names
new_file_path = new_file_path.replace(' ', '-')
os.rename(file_path, new_file_path)
print(f"Renamed file: {file_path} -> {new_file_path}")
if __name__ == '__main__':
remove_ds_store_files()
remove_empty_folders()

View file

@ -1,6 +1,10 @@
import cleanup
if __name__ == '__main__':
## Clean up git repository
#Reset and remove untracked files
os.system("git reset --hard")
os.system("git clean -fdx")
cleanup.remove_ds_store_files()
cleanup.remove_setup_complete_files()
cleanup.remove_empty_folders()
cleanup.remove_empty_folders()