github.com/arunkumar7540/cli@v6.45.0+incompatible/actor/v7pushaction/setup_bits_path_for_push_plan.go (about)

     1  package v7pushaction
     2  
     3  import (
     4  	"os"
     5  
     6  	"code.cloudfoundry.org/cli/util/manifestparser"
     7  	log "github.com/sirupsen/logrus"
     8  )
     9  
    10  func SetupBitsPathForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error) {
    11  	log.Info("determine bits path")
    12  	switch {
    13  	case overrides.ProvidedAppPath != "":
    14  		log.WithField("path", overrides.ProvidedAppPath).Debug("using flag override path for bits path")
    15  		pushPlan.BitsPath = overrides.ProvidedAppPath
    16  	case manifestApp.Path != "":
    17  		log.WithField("path", manifestApp.Path).Debug("using manifest path for bits path")
    18  		pushPlan.BitsPath = manifestApp.Path
    19  	default:
    20  		var err error
    21  		pushPlan.BitsPath, err = os.Getwd()
    22  		log.WithField("path", pushPlan.BitsPath).Debug("using current directory for bits path")
    23  		if err != nil {
    24  			return pushPlan, err
    25  		}
    26  	}
    27  	return pushPlan, nil
    28  }