Skip to content

Commit 07b3be6

Browse files
authored
Merge pull request #586 from thedadams/create-cred-cache-dirs
fix: create the cache directory before writing last-checked file
2 parents a356d09 + 94d0f24 commit 07b3be6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/repos/get.go

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"io/fs"
99
"os"
10+
"path"
1011
"path/filepath"
1112
"strings"
1213
"sync"
@@ -132,6 +133,10 @@ func (m *Manager) deferredSetUpCredentialHelpers(ctx context.Context, cliCfg *co
132133
return err
133134
}
134135

136+
if err := os.MkdirAll(path.Dir(m.credHelperDirs.LastCheckedFile), 0755); err != nil {
137+
return err
138+
}
139+
135140
// Update the last-checked file.
136141
if err := os.WriteFile(m.credHelperDirs.LastCheckedFile, []byte(now.Format(time.RFC3339)), 0644); err != nil {
137142
return err

0 commit comments

Comments
 (0)