Skip to content

Commit 9eff486

Browse files
committed
Address comments
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent fa4cf98 commit 9eff486

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

install_requirements.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
# LICENSE file in the root directory of this source tree.
66

77

8+
import glob
89
import os
910
import platform
1011
import re
12+
import shutil
1113
import subprocess
1214
import sys
1315

@@ -80,12 +82,14 @@ def python_is_compatible():
8082
sys.exit(1)
8183
elif arg == "--clean":
8284
print(f"Cleaning build artifacts...")
83-
if sys.platform == "win32":
84-
subprocess.run(["rmdir", "/s", "cmake-out*/"], check=True)
85-
subprocess.run(["rmdir", "/s", "pip-out/"], check=True)
86-
else:
87-
subprocess.run(["rm", "-rf", "cmake-out*/"], check=True)
88-
subprocess.run(["rm", "-rf", "pip-out/"], check=True)
85+
print("Cleaning pip-out/...")
86+
shutil.rmtree("pip-out/", ignore_errors=True)
87+
dirs = glob.glob("cmake-out*/")
88+
for d in dirs:
89+
print(f"Cleaning {d}...")
90+
shutil.rmtree(d, ignore_errors=True)
91+
print("Done cleaning build artifacts.")
92+
sys.exit(0)
8993
else:
9094
print(f"Error: Unknown option {arg}")
9195
sys.exit(1)

0 commit comments

Comments
 (0)