MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / StartApplication

Function StartApplication

internal/bootstrap/bootstrap.go:481–506  ·  view source on GitHub ↗

StartApplication starts the main application with the given configuration.

(result *BootstrapResult)

Source from the content-addressed store, hash-verified

479
480// StartApplication starts the main application with the given configuration.
481func 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.
509func ResolveConfigPath(flagPath string) string {

Callers 1

runMainApplicationFunction · 0.92

Calls 5

IconTextFunction · 0.92
ApplyCustomThemeFunction · 0.92
ApplyToTviewFunction · 0.92
handleStartupErrorFunction · 0.85

Tested by

no test coverage detected