getConfigApp() does the basic setup of the app (with provider) and returns it.
(_ string)
| 336 | |
| 337 | // getConfigApp() does the basic setup of the app (with provider) and returns it. |
| 338 | func getConfigApp(_ string) *ddevapp.DdevApp { |
| 339 | appRoot, err := os.Getwd() |
| 340 | if err != nil { |
| 341 | util.Failed("Could not determine the current working directory: %v", err) |
| 342 | } |
| 343 | |
| 344 | // Check for an existing config in a parent dir |
| 345 | otherRoot, _ := ddevapp.CheckForConf(appRoot) |
| 346 | if otherRoot != "" && otherRoot != appRoot { |
| 347 | appRoot = otherRoot |
| 348 | err = os.Chdir(appRoot) |
| 349 | if err != nil { |
| 350 | util.Failed("Unable to chdir to %v: %v", appRoot, err) |
| 351 | } |
| 352 | } |
| 353 | app, err := ddevapp.NewApp(appRoot, false) |
| 354 | if err != nil { |
| 355 | util.Failed("Could not create a new config: %v", err) |
| 356 | } |
| 357 | if hasConfigNameOverride, newName := app.HasConfigNameOverride(); hasConfigNameOverride { |
| 358 | app.Name = newName |
| 359 | } |
| 360 | return app |
| 361 | } |
| 362 | |
| 363 | // handleMainConfigArgs() validates and processes the main config args (docroot, etc.) |
| 364 | func handleMainConfigArgs(cmd *cobra.Command, _ []string, app *ddevapp.DdevApp) error { |
no test coverage detected