Skip to content

Commit a766cad

Browse files
Merge pull request #12 from IntegralPilot/clean-revamp
2 parents 60439d5 + eb6244e commit a766cad

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
*.o
66

77
*.exe
8+
9+
stacktestbench
10+
cputestbench
11+
alutestbench

clean.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
# remove *.txt, *.cf, *.vcd in the current directory and all subdirectories of "test"
2-
31
import os
42
import glob
53

6-
# remove all .txt, .cf, and .vcd files in the current directory
7-
for file in glob.glob("*.txt"):
8-
os.remove(file)
9-
for file in glob.glob("*.cf"):
10-
os.remove(file)
11-
for file in glob.glob("*.vcd"):
4+
# File extensions to remove
5+
extensions = (".txt", ".cf", ".vcd", ".o")
6+
7+
# Remove files in the current directory
8+
for ext in extensions:
9+
for file in glob.glob(f"*{ext}"):
10+
os.remove(file)
11+
12+
# Remove files ending with "testbench" in the current directory
13+
for file in glob.glob("*testbench"):
1214
os.remove(file)
1315

14-
# remove all .txt, .cf, and .vcd files in the test directory
16+
# Remove files in "test" and its subdirectories
1517
for root, dirs, files in os.walk("test"):
1618
for file in files:
17-
if file.endswith(".txt") or file.endswith(".cf") or file.endswith(".vcd"):
19+
if file.endswith(extensions) or file.endswith("testbench"):
1820
os.remove(os.path.join(root, file))
1921

20-
print("🧼 Cleaned up files!")
22+
print("🧼 Cleaned up files!")

0 commit comments

Comments
 (0)