This speeds up report output when specifying a flag as extra data that isn't used will not be fetched unnecessarily.
33 lines
808 B
Go
33 lines
808 B
Go
package buildpacks
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/dokku/dokku/plugins/common"
|
|
)
|
|
|
|
// ReportSingleApp is an internal function that displays the app report for one or more apps
|
|
func ReportSingleApp(appName, infoFlag string) error {
|
|
if err := common.VerifyAppName(appName); err != nil {
|
|
return err
|
|
}
|
|
|
|
flags := map[string]common.ReportFunc{
|
|
"--buildpacks-list": reportList,
|
|
}
|
|
|
|
trimPrefix := false
|
|
uppercaseFirstCharacter := true
|
|
infoFlags := common.CollectReport(appName, infoFlag, flags)
|
|
return common.ReportSingleApp("buildpacks", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
|
|
}
|
|
|
|
func reportList(appName string) string {
|
|
buildpacks, err := common.PropertyListGet("buildpacks", appName, "buildpacks")
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
|
|
return strings.Join(buildpacks, ",")
|
|
}
|