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)
| 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. |
| 28 | func 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. |
no test coverage detected