CreateDocroot creates the docroot for the project if it doesn't exist
()
| 1510 | |
| 1511 | // CreateDocroot creates the docroot for the project if it doesn't exist |
| 1512 | func (app *DdevApp) CreateDocroot() error { |
| 1513 | if app.GetDocroot() == "" { |
| 1514 | return nil |
| 1515 | } |
| 1516 | if err := ValidateDocroot(app.GetDocroot()); err != nil { |
| 1517 | return err |
| 1518 | } |
| 1519 | docrootAbsPath := app.GetAbsDocroot(false) |
| 1520 | if !fileutil.IsDirectory(docrootAbsPath) { |
| 1521 | if err := os.MkdirAll(docrootAbsPath, 0755); err != nil { |
| 1522 | return err |
| 1523 | } |
| 1524 | util.Success("Created docroot at %s", docrootAbsPath) |
| 1525 | } |
| 1526 | return nil |
| 1527 | } |
| 1528 | |
| 1529 | // DiscoverDefaultDocroot returns the default docroot directory. |
| 1530 | func DiscoverDefaultDocroot(app *DdevApp) string { |
no test coverage detected