File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 4
4
import click
5
5
from rich import print as richprint
6
6
7
+ from .constants import NETWORK_DIR
7
8
from .namespaces import copy_namespaces_defaults , namespaces
8
9
from .network import copy_network_defaults
9
10
@@ -17,22 +18,6 @@ def admin():
17
18
admin .add_command (namespaces )
18
19
19
20
20
- @admin .command ()
21
- @click .argument ("directory" , type = Path )
22
- def create (directory ):
23
- """Create a new warnet project in the specified directory"""
24
- if os .path .exists (directory ):
25
- richprint (f"[red]Error: Directory { directory } already exists[/red]" )
26
- return
27
-
28
- copy_network_defaults (directory )
29
- copy_namespaces_defaults (directory )
30
- richprint (
31
- f"[green]Copied network and namespace example files to { directory / 'networks' } [/green]"
32
- )
33
- richprint (f"[green]Created warnet project structure in { directory } [/green]" )
34
-
35
-
36
21
@admin .command ()
37
22
def init ():
38
23
"""Initialize a warnet project in the current directory"""
@@ -45,6 +30,6 @@ def init():
45
30
copy_network_defaults (Path (current_dir ))
46
31
copy_namespaces_defaults (Path (current_dir ))
47
32
richprint (
48
- f"[green]Copied network and namespace example files to { Path (current_dir ) / 'networks' } [/green]"
33
+ f"[green]Copied network and namespace example files to { Path (current_dir ) / NETWORK_DIR . name } [/green]"
49
34
)
50
35
richprint (f"[green]Created warnet project structure in { current_dir } [/green]" )
You can’t perform that action at this time.
0 commit comments