Skip to content

Commit 4ae65c2

Browse files
Fail on non-existing ccache
1 parent b58e100 commit 4ae65c2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

options.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,13 @@ func (opts *Options) preliminaryCredential() (*Credential, error) {
262262

263263
if opts.CCache != "" {
264264
s, err := os.Stat(opts.CCache)
265-
if err == nil && !s.IsDir() {
266-
ccache = opts.CCache
265+
if err != nil {
266+
return nil, fmt.Errorf("stat CCache path: %w", err)
267+
} else if s.IsDir() {
268+
return nil, fmt.Errorf("CCache path is a directory: %s", opts.CCache)
267269
}
270+
271+
ccache = opts.CCache
268272
}
269273

270274
cred := &Credential{

0 commit comments

Comments
 (0)