StartApplication starts the main application with the given configuration.
(result *BootstrapResult)
| 479 | |
| 480 | // StartApplication starts the main application with the given configuration. |
| 481 | func StartApplication(result *BootstrapResult) error { |
| 482 | if result == nil { |
| 483 | return fmt.Errorf("bootstrap result is nil") |
| 484 | } |
| 485 | |
| 486 | if result.ConfigPath != "" { |
| 487 | fmt.Println(display.IconText("✅", fmt.Sprintf("Configuration loaded from %s", result.ConfigPath), result.Config.ShowIcons)) |
| 488 | } else { |
| 489 | fmt.Println(display.IconText("✅", "Configuration loaded from environment variables", result.Config.ShowIcons)) |
| 490 | } |
| 491 | |
| 492 | // Apply theme configuration |
| 493 | theme.ApplyCustomTheme(&result.Config.Theme) |
| 494 | theme.ApplyToTview() |
| 495 | |
| 496 | appOpts := app.Options{ |
| 497 | NoCache: result.NoCache, |
| 498 | InitialGroup: result.InitialGroup, |
| 499 | } |
| 500 | if err := app.RunWithStartupVerification(result.Config, result.ConfigPath, appOpts); err != nil { |
| 501 | return handleStartupError(err, result.Config) |
| 502 | } |
| 503 | |
| 504 | fmt.Println(display.IconText("🚪", "Exiting.", result.Config.ShowIcons)) |
| 505 | return nil |
| 506 | } |
| 507 | |
| 508 | // ResolveConfigPath resolves the configuration file path. |
| 509 | func ResolveConfigPath(flagPath string) string { |
no test coverage detected