addUploadDir adds a new upload dir if it does not already exist in the list.
(uploadDir string)
| 14 | |
| 15 | // addUploadDir adds a new upload dir if it does not already exist in the list. |
| 16 | func (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 |
no test coverage detected