Check if this is the first run and prompt for language setup.
()
| 75 | |
| 76 | |
| 77 | def check_first_run() -> None: |
| 78 | """Check if this is the first run and prompt for language setup.""" |
| 79 | import os |
| 80 | |
| 81 | # Skip if not running in interactive terminal |
| 82 | if not sys.stdin.isatty(): |
| 83 | return |
| 84 | |
| 85 | from kt_kernel.cli.config.settings import DEFAULT_CONFIG_FILE |
| 86 | |
| 87 | # Only check if config file exists - don't create it yet |
| 88 | if not DEFAULT_CONFIG_FILE.exists(): |
| 89 | # First run - show welcome and language selection |
| 90 | from kt_kernel.cli.config.settings import get_settings |
| 91 | |
| 92 | settings = get_settings() |
| 93 | _show_first_run_setup(settings) |
| 94 | else: |
| 95 | # Config exists - check if initialized |
| 96 | from kt_kernel.cli.config.settings import get_settings |
| 97 | |
| 98 | settings = get_settings() |
| 99 | if not settings.get("general._initialized"): |
| 100 | _show_first_run_setup(settings) |
| 101 | |
| 102 | |
| 103 | def _show_first_run_setup(settings) -> None: |
no test coverage detected