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

Method addUploadDir

pkg/ddevapp/upload_dirs.go:16–27  ·  view source on GitHub ↗

addUploadDir adds a new upload dir if it does not already exist in the list.

(uploadDir string)

Source from the content-addressed store, hash-verified

14
15// addUploadDir adds a new upload dir if it does not already exist in the list.
16func (app *DdevApp) addUploadDir(uploadDir string) {
17 err := app.validateUploadDirs()
18 if err != nil {
19 util.Failed("Failed to validate upload_dirs: %v", err)
20 }
21
22 if slices.Contains(app.UploadDirs, uploadDir) {
23 return
24 }
25
26 app.UploadDirs = append(app.UploadDirs, uploadDir)
27}
28
29// GetUploadDir returns the first upload (public files) directory.
30// This value is relative to the docroot

Callers 2

GetUploadDirsMethod · 0.95
NewAppFunction · 0.95

Calls 2

validateUploadDirsMethod · 0.95
FailedFunction · 0.92

Tested by

no test coverage detected