Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
*.o

*.exe

stacktestbench
cputestbench
alutestbench
24 changes: 13 additions & 11 deletions clean.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# remove *.txt, *.cf, *.vcd in the current directory and all subdirectories of "test"

import os
import glob

# remove all .txt, .cf, and .vcd files in the current directory
for file in glob.glob("*.txt"):
os.remove(file)
for file in glob.glob("*.cf"):
os.remove(file)
for file in glob.glob("*.vcd"):
# File extensions to remove
extensions = (".txt", ".cf", ".vcd", ".o")

# Remove files in the current directory
for ext in extensions:
for file in glob.glob(f"*{ext}"):
os.remove(file)

# Remove files ending with "testbench" in the current directory
for file in glob.glob("*testbench"):
os.remove(file)

# remove all .txt, .cf, and .vcd files in the test directory
# Remove files in "test" and its subdirectories
for root, dirs, files in os.walk("test"):
for file in files:
if file.endswith(".txt") or file.endswith(".cf") or file.endswith(".vcd"):
if file.endswith(extensions) or file.endswith("testbench"):
os.remove(os.path.join(root, file))

print("🧼 Cleaned up files!")
print("🧼 Cleaned up files!")