MCPcopy Index your code
hub / github.com/cloudfoundry/cli / processPathCallback

Method processPathCallback

cf/commands/application/push.go:302–333  ·  view source on GitHub ↗
(path string, app models.Application)

Source from the content-addressed store, hash-verified

300}
301
302func (cmd *Push) processPathCallback(path string, app models.Application) func(string) error {
303 return func(appDir string) error {
304 localFiles, err := cmd.appfiles.AppFilesInDir(appDir)
305 if err != nil {
306 return errors.New(
307 T("Error processing app files in '{{.Path}}': {{.Error}}",
308 map[string]interface{}{
309 "Path": path,
310 "Error": err.Error(),
311 }))
312 }
313
314 if len(localFiles) == 0 {
315 return errors.New(
316 T("No app files found in '{{.Path}}'",
317 map[string]interface{}{
318 "Path": path,
319 }))
320 }
321
322 cmd.ui.Say(T("Uploading {{.AppName}}...",
323 map[string]interface{}{"AppName": terminal.EntityNameColor(app.Name)}))
324
325 err = cmd.uploadApp(app.GUID, appDir, path, localFiles)
326 if err != nil {
327 return errors.New(T("Error uploading application.\n{{.APIErr}}",
328 map[string]interface{}{"APIErr": err.Error()}))
329 }
330 cmd.ui.Ok()
331 return nil
332 }
333}
334
335func (cmd *Push) updateRoutes(app models.Application, appParams models.AppParams, appParamsFromContext models.AppParams) error {
336 defaultRouteAcceptable := len(app.Routes) == 0

Callers 1

ExecuteMethod · 0.95

Calls 7

uploadAppMethod · 0.95
NewFunction · 0.92
EntityNameColorFunction · 0.92
AppFilesInDirMethod · 0.65
ErrorMethod · 0.65
SayMethod · 0.65
OkMethod · 0.65

Tested by

no test coverage detected