MCPcopy Index your code
hub / github.com/devspace-sh/devspace / GetDependencyID

Function GetDependencyID

pkg/devspace/dependency/util/util.go:232–255  ·  view source on GitHub ↗
(source *latest.SourceConfig)

Source from the content-addressed store, hash-verified

230}
231
232func GetDependencyID(source *latest.SourceConfig) (string, error) {
233 // check if source is there
234 if source == nil {
235 return "", fmt.Errorf("source is missing")
236 }
237
238 // get id for git
239 if source.Git != "" {
240 id := source.Git
241 if source.Branch != "" {
242 id += "@" + source.Branch
243 } else if source.Tag != "" {
244 id += "@tag:" + source.Tag
245 } else if source.Revision != "" {
246 id += "@revision:" + source.Revision
247 }
248
249 return encoding.Convert(id), nil
250 } else if source.Path != "" {
251 return source.Path, nil
252 }
253
254 return "", fmt.Errorf("unexpected dependency config, both source.git and source.path are missing")
255}
256
257func isURL(path string) bool {
258 return strings.HasPrefix(path, "http://") || strings.HasPrefix(path, "https://")

Callers 3

mustGetDependencyIDFunction · 0.92
GetDependencyPathFunction · 0.85
DownloadDependencyFunction · 0.85

Calls 2

ConvertFunction · 0.92
ErrorfMethod · 0.45

Tested by 1

mustGetDependencyIDFunction · 0.74