Skip to content

Commit f6f836b

Browse files
committed
1 parent ca646f3 commit f6f836b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sync_lock.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package dejavu
1818

1919
import (
2020
"errors"
21+
"os"
2122
"path/filepath"
2223
"strings"
2324
"time"
@@ -133,6 +134,13 @@ func (repo *Repo) lockCloud(currentDeviceID string, context map[string]interface
133134
}
134135

135136
func (repo *Repo) lockCloud0(currentDeviceID string) (err error) {
137+
if !gulu.File.IsDir(repo.Path) {
138+
if err = os.MkdirAll(repo.Path, 0755); nil != err {
139+
logging.LogErrorf("create repo dir failed: %s", err)
140+
return
141+
}
142+
}
143+
136144
lockSyncPath := filepath.Join(repo.Path, lockSyncKey)
137145
content := map[string]interface{}{
138146
"deviceID": currentDeviceID,

0 commit comments

Comments
 (0)