Skip to content

Commit

Permalink
Merge pull request #783 from aaronbell/main
Browse files Browse the repository at this point in the history
Update _ninja.py
  • Loading branch information
m4rc1e authored Mar 6, 2024
2 parents 24042bb + bfe6506 commit 3678746
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Lib/gftools/builder/_ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,20 @@ def build(self):
os.remove(temporary)

# Clean up temp build files
search_directory = os.getcwd()
target_names = ["build.ninja", ".ninja_log", "instance_ufo", "master_ufo"]
for root, dirs, files in os.walk(search_directory, topdown=False):
for file in files:
if file in target_names:
file_path = os.path.join(root, file)
os.remove(file_path)
print(f"Removed file: {file_path}")
for dir_name in dirs:
if dir_name in target_names:
dir_path = os.path.join(root, dir_name)
shutil.rmtree(dir_path)
print(f"Removed directory: {dir_path}")
if self.config["cleanUp"]:
search_directory = os.getcwd()
target_names = ["build.ninja", ".ninja_log", "instance_ufo", "master_ufo"]
for root, dirs, files in os.walk(search_directory, topdown=False):
for file in files:
if file in target_names:
file_path = os.path.join(root, file)
os.remove(file_path)
print(f"Removed file: {file_path}")
for dir_name in dirs:
if dir_name in target_names:
dir_path = os.path.join(root, dir_name)
shutil.rmtree(dir_path)
print(f"Removed directory: {dir_path}")

print("Done building fonts!")

Expand Down

0 comments on commit 3678746

Please sign in to comment.