HandleConfigWizard launches the configuration wizard.
(cfg *config.Config, configPath string, activeProfile string)
| 536 | |
| 537 | // HandleConfigWizard launches the configuration wizard. |
| 538 | func HandleConfigWizard(cfg *config.Config, configPath string, activeProfile string) error { |
| 539 | res := components.LaunchConfigWizard(cfg, configPath, activeProfile) |
| 540 | |
| 541 | switch { |
| 542 | case res.SopsEncrypted: |
| 543 | fmt.Println(display.IconText("✅", fmt.Sprintf("Configuration saved and encrypted with SOPS: %s", configPath), cfg.ShowIcons)) |
| 544 | case res.Saved: |
| 545 | fmt.Println(display.IconText("✅", "Configuration saved.", cfg.ShowIcons)) |
| 546 | case res.Canceled: |
| 547 | fmt.Println(display.IconText("🚪", "Exiting.", cfg.ShowIcons)) |
| 548 | } |
| 549 | |
| 550 | return nil |
| 551 | } |
| 552 | |
| 553 | // handleStartupError provides user-friendly error messages for startup failures. |
| 554 | func handleStartupError(err error, cfg *config.Config) error { |
no test coverage detected