MCPcopy Index your code
hub / github.com/ddev/ddev / addPathToAddonMap

Function addPathToAddonMap

pkg/ddevapp/config_custom.go:28–43  ·  view source on GitHub ↗

addPathToAddonMap adds a file path (or all files under a directory) to the add-on map. Manifest ProjectFiles/GlobalFiles may contain directory paths; this expands them.

(fullPath string, addonName string, addonFileMap map[string]string)

Source from the content-addressed store, hash-verified

26// addPathToAddonMap adds a file path (or all files under a directory) to the add-on map.
27// Manifest ProjectFiles/GlobalFiles may contain directory paths; this expands them.
28func addPathToAddonMap(fullPath string, addonName string, addonFileMap map[string]string) {
29 info, err := os.Stat(fullPath)
30 if err != nil {
31 return
32 }
33 if info.IsDir() {
34 files, err := fileutil.ListFilesWithDepth(fullPath, -1)
35 if err == nil {
36 for _, f := range files {
37 addonFileMap[f] = addonName
38 }
39 }
40 return
41 }
42 addonFileMap[fullPath] = addonName
43}
44
45// CheckCustomConfig checks for custom configuration files and returns a message.
46// If showAll is true, files with #ddev-silent-no-warn marker are included in the output.

Callers 1

CheckCustomConfigMethod · 0.85

Calls 1

ListFilesWithDepthFunction · 0.92

Tested by

no test coverage detected