Skip to content

Commit b2cbaa3

Browse files
authored
Merge pull request #40 from infosiftr/format-ociPlatform
Add "ociPlatform" template function
2 parents 22e529f + 42b3163 commit b2cbaa3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/bashbrew/cmd-cat.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import (
77
"strings"
88
"text/template"
99

10-
"github.com/urfave/cli"
10+
"github.com/docker-library/bashbrew/architecture"
1111
"github.com/docker-library/bashbrew/manifest"
1212
"github.com/docker-library/bashbrew/pkg/templatelib"
13+
"github.com/urfave/cli"
1314
)
1415

1516
var DefaultCatFormat = `
@@ -55,6 +56,12 @@ func cmdCat(c *cli.Context) error {
5556
"arch": func() string {
5657
return arch
5758
},
59+
"ociPlatform": func(arch string) *architecture.OCIPlatform {
60+
if ociArch, ok := architecture.SupportedArches[arch]; ok {
61+
return &ociArch
62+
}
63+
return nil
64+
},
5865
"namespace": func() string {
5966
return namespace
6067
},

0 commit comments

Comments
 (0)