cleanup after itself.
This commit is contained in:
parent
522f6154d0
commit
689ed19245
2 changed files with 16 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue