add feature to onboarding that will ask to generate missing workspace files
This commit is contained in:
parent
890d7cf853
commit
f016025f63
@ -163,9 +163,12 @@ def onboard():
|
|||||||
|
|
||||||
if config_path.exists():
|
if config_path.exists():
|
||||||
console.print(f"[yellow]Config already exists at {config_path}[/yellow]")
|
console.print(f"[yellow]Config already exists at {config_path}[/yellow]")
|
||||||
if not typer.confirm("Overwrite?"):
|
if typer.confirm("Overwrite?"):
|
||||||
raise typer.Exit()
|
# Create default config
|
||||||
|
config = Config()
|
||||||
|
save_config(config)
|
||||||
|
console.print(f"[green]✓[/green] Created config at {config_path}")
|
||||||
|
else:
|
||||||
# Create default config
|
# Create default config
|
||||||
config = Config()
|
config = Config()
|
||||||
save_config(config)
|
save_config(config)
|
||||||
@ -173,9 +176,18 @@ def onboard():
|
|||||||
|
|
||||||
# Create workspace
|
# Create workspace
|
||||||
workspace = get_workspace_path()
|
workspace = get_workspace_path()
|
||||||
|
|
||||||
|
create_templates = True
|
||||||
|
if workspace.exists():
|
||||||
|
console.print(f"[yellow]Workspace already exists at {workspace}[/yellow]")
|
||||||
|
if not typer.confirm("Create missing default templates? (will not overwrite existing files)"):
|
||||||
|
create_templates = False
|
||||||
|
else:
|
||||||
|
workspace.mkdir(parents=True, exist_ok=True)
|
||||||
console.print(f"[green]✓[/green] Created workspace at {workspace}")
|
console.print(f"[green]✓[/green] Created workspace at {workspace}")
|
||||||
|
|
||||||
# Create default bootstrap files
|
# Create default bootstrap files
|
||||||
|
if create_templates:
|
||||||
_create_workspace_templates(workspace)
|
_create_workspace_templates(workspace)
|
||||||
|
|
||||||
console.print(f"\n{__logo__} nanobot is ready!")
|
console.print(f"\n{__logo__} nanobot is ready!")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user