MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / _confirm_bundle_clear

Function _confirm_bundle_clear

src/codegraphcontext/cli/main.py:662–678  ·  view source on GitHub ↗

Return True if import may proceed; False if user cancelled.

(clear: bool, yes: bool)

Source from the content-addressed store, hash-verified

660 db_manager.close_driver()
661
662def _confirm_bundle_clear(clear: bool, yes: bool) -> bool:
663 """Return True if import may proceed; False if user cancelled."""
664 if not clear:
665 return True
666 console.print("[yellow]⚠️ Warning: This will clear all existing graph data![/yellow]")
667 if yes:
668 return True
669 if not sys.stdin.isatty():
670 console.print(
671 "[bold red]Refusing to clear graph in non-interactive mode. "
672 "Pass --yes / -y to confirm.[/bold red]"
673 )
674 raise typer.Exit(code=1)
675 if not typer.confirm("Are you sure you want to continue?", default=False):
676 console.print("[yellow]Import cancelled[/yellow]")
677 return False
678 return True
679
680
681@bundle_app.command("import")

Callers 1

bundle_importFunction · 0.85

Calls 1

printMethod · 0.80

Tested by

no test coverage detected