Skip to content

Commit 93c281c

Browse files
committed
Address Copilot feedback
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
1 parent d32a882 commit 93c281c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

scripts/tasks.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ def doc_open():
99
path = "docs/build/html/index.html"
1010
print(f"Opening {path} in web browser...")
1111
abs_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), path)
12+
if not os.path.exists(abs_path):
13+
print(f"Error: {path} does not exist. Please run 'npm run doc:build' first.")
14+
sys.exit(1)
1215
webbrowser.open("file://" + abs_path.replace("\\", "/"))
1316

1417

@@ -21,8 +24,13 @@ def env_active():
2124
def env_delete():
2225
"""Deletes the 'env' directory."""
2326
print("Deleting virtual environment 'env'...")
24-
shutil.rmtree("env", ignore_errors=True)
25-
print("'env' deleted.")
27+
try:
28+
shutil.rmtree("env")
29+
print("'env' deleted.")
30+
except FileNotFoundError:
31+
print("Virtual environment 'env' does not exist.")
32+
except Exception as e:
33+
print(f"Failed to delete 'env': {e}")
2634

2735

2836
if __name__ == "__main__":

0 commit comments

Comments
 (0)