(scope Scope)
| 36 | } |
| 37 | |
| 38 | func (c *yamlToolConfig) PathFor(scope Scope) string { |
| 39 | switch scope { |
| 40 | case UserScope: |
| 41 | paths := c.UserPaths() |
| 42 | for _, p := range paths { |
| 43 | if pathutil.Exists(p) { |
| 44 | return p |
| 45 | } |
| 46 | } |
| 47 | if len(paths) > 0 { |
| 48 | return paths[0] |
| 49 | } |
| 50 | case ProjectScope: |
| 51 | return c.ProjectPath() |
| 52 | } |
| 53 | return "" |
| 54 | } |
| 55 | |
| 56 | func (c *yamlToolConfig) Load(scope Scope) (map[string]any, string, error) { |
| 57 | path := c.PathFor(scope) |