File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11import os
22import random
3+ import sys
34from importlib .resources import files
45from pathlib import Path
56
@@ -36,7 +37,13 @@ def custom_graph(
3637 caddy : bool ,
3738 logging : bool ,
3839):
39- datadir .mkdir (parents = False , exist_ok = False )
40+ try :
41+ datadir .mkdir (parents = False , exist_ok = False )
42+ except FileExistsError as e :
43+ print (e )
44+ print ("Exiting network builder without overwriting" )
45+ sys .exit (1 )
46+
4047 # Generate network.yaml
4148 nodes = []
4249 connections = set ()
@@ -211,7 +218,7 @@ def create():
211218 # Check if the project has a networks directory
212219 if not (project_path / "networks" ).exists ():
213220 click .secho (
214- "The current directory does not have a 'networks' directory. Please run 'warnet init' or 'warnet create ' first." ,
221+ "The current directory does not have a 'networks' directory. Please run 'warnet init' or 'warnet new ' first." ,
215222 fg = "red" ,
216223 bold = True ,
217224 )
You can’t perform that action at this time.
0 commit comments