Skip to content

Commit ef8e708

Browse files
mplsgrantpinheadmz
authored andcommitted
expand project path
This means if a user does ~/mydir, it won't explicitly create a directory called `~`
1 parent 2a9af4f commit ef8e708

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/warnet/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def quickstart():
103103
click.secho("Setup cancelled by user.", fg="yellow")
104104
return False
105105
if not proj_answers["custom_network"]:
106-
create_warnet_project(Path(proj_answers["project_path"]))
106+
project_path = Path(os.path.expanduser(proj_answers["project_path"]))
107+
create_warnet_project(project_path)
107108
click.secho("\nSetup completed successfully!", fg="green", bold=True)
108109
click.echo(
109110
"\nRun the following command to deploy this network using the default demo network:"
@@ -183,9 +184,10 @@ def quickstart():
183184
answers.update(net_answers)
184185

185186
click.secho("\nCreating project structure...", fg="yellow", bold=True)
186-
create_warnet_project(Path(answers["project_path"]))
187+
project_path = Path(os.path.expanduser(proj_answers["project_path"]))
188+
create_warnet_project(project_path)
187189
click.secho("\nGenerating custom network...", fg="yellow", bold=True)
188-
custom_network_path = Path(answers["project_path"]) / "networks" / answers["network_name"]
190+
custom_network_path = project_path / "networks" / answers["network_name"]
189191
custom_graph(
190192
int(answers["nodes"]),
191193
int(answers["connections"]),

0 commit comments

Comments
 (0)