no message
This commit is contained in:
parent
1c91c9d74b
commit
a829efc23a
1 changed files with 7 additions and 5 deletions
|
|
@ -220,13 +220,14 @@ def remove_setup_complete_files(root_path=font_location):
|
|||
print(f"Removed .setup_complete file: {file_path}")
|
||||
|
||||
def remove_spaces_in_dir_names(root_path=font_location):
|
||||
for dir in os.listdir(root_path):
|
||||
dir_path = os.path.join(root_path, dir)
|
||||
if os.path.isdir(dir_path):
|
||||
#If directory name contains spaces, replace them with dashes
|
||||
for root, dirs, files in os.walk(root_path, topdown=False):
|
||||
for dir in dirs:
|
||||
dir_path = os.path.join(root, dir)
|
||||
if ' ' in dir:
|
||||
new_dir = dir.replace(' ', '-')
|
||||
new_dir_path = os.path.join(root_path, new_dir)
|
||||
#lowercase the new directory name
|
||||
new_dir = new_dir.lower()
|
||||
new_dir_path = os.path.join(root, new_dir)
|
||||
os.rename(dir_path, new_dir_path)
|
||||
print(f"Renamed directory: {dir_path} -> {new_dir_path}")
|
||||
|
||||
|
|
@ -243,6 +244,7 @@ def prepend_folder_name_to_font_dash(root_path=font_location):
|
|||
print(f"Renamed directory: {dir_path} -> {new_dir_path}")
|
||||
|
||||
|
||||
|
||||
def lowercase_and_dash_file_names(root_path=font_location):
|
||||
for root, dirs, files in os.walk(root_path):
|
||||
for file in files:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue