Skip to content

Commit cec429f

Browse files
committed
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.
1 parent c7d3d0d commit cec429f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/bashbrew/cmd-cat.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ func cmdCat(c *cli.Context) error {
5656
"arch": func() string {
5757
return arch
5858
},
59+
"gitCache": func() (string, error) {
60+
err := ensureGitInit()
61+
if err != nil {
62+
return "", err
63+
}
64+
return gitCache(), nil
65+
},
5966
"ociPlatform": func(arch string) *architecture.OCIPlatform {
6067
if ociArch, ok := architecture.SupportedArches[arch]; ok {
6168
return &ociArch

0 commit comments

Comments
 (0)