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 1
1
import os
2
2
import random
3
+ import sys
3
4
from importlib .resources import files
4
5
from pathlib import Path
5
6
@@ -36,7 +37,13 @@ def custom_graph(
36
37
caddy : bool ,
37
38
logging : bool ,
38
39
):
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
+
40
47
# Generate network.yaml
41
48
nodes = []
42
49
connections = set ()
@@ -211,7 +218,7 @@ def create():
211
218
# Check if the project has a networks directory
212
219
if not (project_path / "networks" ).exists ():
213
220
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." ,
215
222
fg = "red" ,
216
223
bold = True ,
217
224
)
You can’t perform that action at this time.
0 commit comments