Skip to content

Commit 5173357

Browse files
authored
fix: create cred helper dir properly on Windows (#603)
Signed-off-by: Grant Linville <[email protected]>
1 parent 134dcde commit 5173357

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/credentials/util.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
)
66

77
type CredentialHelperDirs struct {
8-
RevisionFile, LastCheckedFile, BinDir, RepoDir string
8+
RevisionFile, LastCheckedFile, BinDir, RepoDir, HelperDir string
99
}
1010

1111
func GetCredentialHelperDirs(cacheDir string) CredentialHelperDirs {
@@ -14,5 +14,6 @@ func GetCredentialHelperDirs(cacheDir string) CredentialHelperDirs {
1414
LastCheckedFile: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers", "last-checked"),
1515
BinDir: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers", "bin"),
1616
RepoDir: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers", "repo"),
17+
HelperDir: filepath.Join(cacheDir, "repos", "gptscript-credential-helpers"),
1718
}
1819
}

pkg/repos/get.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"io/fs"
99
"os"
10-
"path"
1110
"path/filepath"
1211
"strings"
1312
"sync"
@@ -133,7 +132,7 @@ func (m *Manager) deferredSetUpCredentialHelpers(ctx context.Context, cliCfg *co
133132
return err
134133
}
135134

136-
if err := os.MkdirAll(path.Dir(m.credHelperDirs.LastCheckedFile), 0755); err != nil {
135+
if err := os.MkdirAll(m.credHelperDirs.HelperDir, 0755); err != nil {
137136
return err
138137
}
139138

0 commit comments

Comments
 (0)