Skip to content

Commit 0688c3b

Browse files
committed
fix test
1 parent 05bd576 commit 0688c3b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

credentials/oauth/lock.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package oauth
22

33
import (
44
"fmt"
5+
"os"
6+
"path/filepath"
57
"sync"
68

79
"github.com/alexflint/go-filemutex"
@@ -29,6 +31,10 @@ func (l *lockerAdaptor) Unlock() {
2931
}
3032

3133
func newLocker(path string) (sync.Locker, error) {
34+
dirName := filepath.Dir(path)
35+
if _, err := os.Stat(dirName); err != nil && os.IsNotExist(err) {
36+
os.MkdirAll(dirName, 0750)
37+
}
3238
m, err := filemutex.New(path)
3339
if err != nil {
3440
return nil, err

0 commit comments

Comments
 (0)