File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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():
2124def 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
2836if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments