LoadLocalSource reads a JSON repo file from the given path, expanding ~. Used for both config.yaml local sources and direct path lookups.
(path string)
| 236 | // LoadLocalSource reads a JSON repo file from the given path, expanding ~. |
| 237 | // Used for both config.yaml local sources and direct path lookups. |
| 238 | func LoadLocalSource(path string) (map[string]RepoEntry, error) { |
| 239 | resolved := pathutil.Expand(path) |
| 240 | data, err := os.ReadFile(resolved) |
| 241 | if err != nil { |
| 242 | if os.IsNotExist(err) { |
| 243 | return nil, nil |
| 244 | } |
| 245 | return nil, err |
| 246 | } |
| 247 | return parseRepoJSON(data) |
| 248 | } |
| 249 | |
| 250 | func loadRemoteWithCache(url string, kind entities.Kind, cache camconfig.CacheConfig) (map[string]RepoEntry, error) { |
| 251 | if cache.Enabled { |