Skip to content

Commit

Permalink
Add supported platform APIs to pack report (#810)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Cooper <cooper.daniel45@gmail.com>
  • Loading branch information
danielcooperxyz committed Aug 21, 2020
1 parent 10f5f0a commit 112767d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/commands/report.go
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/spf13/cobra"

"github.com/buildpacks/pack/internal/build"
"github.com/buildpacks/pack/internal/builder"
"github.com/buildpacks/pack/internal/config"
"github.com/buildpacks/pack/logging"
Expand Down Expand Up @@ -48,6 +49,8 @@ func generateOutput(writer io.Writer, version string, explicit bool) error {
Default Lifecycle Version: {{ .DefaultLifecycleVersion }}
Supported Platform APIs: {{ .SupportedPlatformAPIs }}
Config:
{{ .Config -}}`))

Expand All @@ -68,11 +71,20 @@ Config:
configData = strings.TrimRight(padded.String(), " \n")
}

platformAPIs := ""
for _, api := range build.SupportedPlatformAPIVersions {
if len(platformAPIs) > 0 {
platformAPIs += ","
}
platformAPIs = fmt.Sprintf("%s %s", platformAPIs, api)
}

return tpl.Execute(writer, map[string]string{
"Version": version,
"OS": runtime.GOOS,
"Arch": runtime.GOARCH,
"DefaultLifecycleVersion": builder.DefaultLifecycleVersion,
"SupportedPlatformAPIs": platformAPIs,
"Config": configData,
})
}
Expand Down

0 comments on commit 112767d

Please sign in to comment.