MCPcopy Create free account
hub / github.com/cloudfoundry/cli / getAppParamsFromManifest

Method getAppParamsFromManifest

cf/commands/application/push.go:560–593  ·  view source on GitHub ↗
(c flags.FlagContext)

Source from the content-addressed store, hash-verified

558}
559
560func (cmd *Push) getAppParamsFromManifest(c flags.FlagContext) ([]models.AppParams, error) {
561 if c.Bool("no-manifest") {
562 return []models.AppParams{}, nil
563 }
564
565 var path string
566 if c.String("f") != "" {
567 path = c.String("f")
568 } else {
569 var err error
570 path, err = os.Getwd()
571 if err != nil {
572 return nil, errors.New(fmt.Sprint(T("Could not determine the current working directory!"), err))
573 }
574 }
575
576 m, err := cmd.manifestRepo.ReadManifest(path)
577
578 if err != nil {
579 if m.Path == "" && c.String("f") == "" {
580 return []models.AppParams{}, nil
581 }
582 return nil, errors.New(T("Error reading manifest file:\n{{.Err}}", map[string]interface{}{"Err": err.Error()}))
583 }
584
585 apps, err := m.Applications()
586 if err != nil {
587 return nil, errors.New(T("Error reading manifest file:\n{{.Err}}", map[string]interface{}{"Err": err.Error()}))
588 }
589
590 cmd.ui.Say(T("Using manifest file {{.Path}}\n",
591 map[string]interface{}{"Path": terminal.EntityNameColor(m.Path)}))
592 return apps, nil
593}
594
595func (cmd *Push) createAppSetFromContextAndManifest(contextApp models.AppParams, manifestApps []models.AppParams) ([]models.AppParams, error) {
596 var err error

Callers 1

ExecuteMethod · 0.95

Calls 8

NewFunction · 0.92
EntityNameColorFunction · 0.92
ApplicationsMethod · 0.80
BoolMethod · 0.65
StringMethod · 0.65
ReadManifestMethod · 0.65
ErrorMethod · 0.65
SayMethod · 0.65

Tested by

no test coverage detected