MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / LoadFromConfig

Method LoadFromConfig

internal/tui/settings.go:58–69  ·  view source on GitHub ↗

LoadFromConfig populates settings items from a config.

(cfg *config.Config)

Source from the content-addressed store, hash-verified

56
57// LoadFromConfig populates settings items from a config.
58func (s *SettingsOverlay) LoadFromConfig(cfg *config.Config) {
59 s.items = []SettingsItem{
60 {Section: "Worktree", Label: "Setup command", Key: "worktree.setup", Type: SettingsItemString, StringVal: cfg.Worktree.Setup},
61 {Section: "On Complete", Label: "Push to remote", Key: "onComplete.push", Type: SettingsItemBool, BoolVal: cfg.OnComplete.Push},
62 {Section: "On Complete", Label: "Create pull request", Key: "onComplete.createPR", Type: SettingsItemBool, BoolVal: cfg.OnComplete.CreatePR},
63 }
64 s.selectedIndex = 0
65 s.editing = false
66 s.editBuffer = ""
67 s.ghError = ""
68 s.showGHError = false
69}
70
71// ApplyToConfig writes the current settings values back to a config.
72func (s *SettingsOverlay) ApplyToConfig(cfg *config.Config) {

Calls

no outgoing calls