ResolveConfigPathForWizard resolves a configuration path for the config wizard. It prefers an explicit flag path, then an existing default config file, and finally falls back to the standard default path so the wizard can create it.
(flagPath string)
| 523 | // It prefers an explicit flag path, then an existing default config file, and |
| 524 | // finally falls back to the standard default path so the wizard can create it. |
| 525 | func ResolveConfigPathForWizard(flagPath string) string { |
| 526 | if flagPath != "" { |
| 527 | return flagPath |
| 528 | } |
| 529 | |
| 530 | if path, found := config.FindDefaultConfigPath(); found { |
| 531 | return path |
| 532 | } |
| 533 | |
| 534 | return config.GetDefaultConfigPath() |
| 535 | } |
| 536 | |
| 537 | // HandleConfigWizard launches the configuration wizard. |
| 538 | func HandleConfigWizard(cfg *config.Config, configPath string, activeProfile string) error { |