Add "gitCache" template function
This not only returns the path to the "git cache" directory, but ensures it is initialized and that `git` commands against it will generally succeed.
This commit is contained in:
parent
c7d3d0d935
commit
cec429fa53
|
|
@ -56,6 +56,13 @@ func cmdCat(c *cli.Context) error {
|
|||
"arch": func() string {
|
||||
return arch
|
||||
},
|
||||
"gitCache": func() (string, error) {
|
||||
err := ensureGitInit()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return gitCache(), nil
|
||||
},
|
||||
"ociPlatform": func(arch string) *architecture.OCIPlatform {
|
||||
if ociArch, ok := architecture.SupportedArches[arch]; ok {
|
||||
return &ociArch
|
||||
|
|
|
|||
Loading…
Reference in New Issue