MCPcopy Create free account
hub / github.com/driangle/taskmd / LoadDefaultProject

Function LoadDefaultProject

apps/cli/internal/cli/registry.go:63–80  ·  view source on GitHub ↗

LoadDefaultProject reads the default_project key from the global config. Returns empty string if not set or if the config file doesn't exist.

()

Source from the content-addressed store, hash-verified

61// LoadDefaultProject reads the default_project key from the global config.
62// Returns empty string if not set or if the config file doesn't exist.
63func LoadDefaultProject() string {
64 cfgPath, err := globalConfigPath()
65 if err != nil {
66 return ""
67 }
68
69 data, err := os.ReadFile(cfgPath)
70 if err != nil {
71 return ""
72 }
73
74 var cfg globalConfig
75 if err := yaml.Unmarshal(data, &cfg); err != nil {
76 return ""
77 }
78
79 return cfg.DefaultProject
80}
81
82// parseProjectEntries converts raw YAML entries into validated GlobalProjectEntry values.
83func parseProjectEntries(projects []globalProjectYAML, cfgDir string) ([]GlobalProjectEntry, error) {

Calls 1

globalConfigPathFunction · 0.85