mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
This commit is contained in:
parent
596ea7689a
commit
c269c10442
3 changed files with 17 additions and 2 deletions
|
|
@ -50,6 +50,18 @@ func InitRepoKey() (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
var indexCallbacks = map[string]dejavu.Callback{
|
||||
"walkData": func(context, arg interface{}, err error) {
|
||||
context.(func(msg string))(arg.(string))
|
||||
},
|
||||
"getLatestFile": func(context, arg interface{}, err error) {
|
||||
context.(func(msg string))(arg.(string))
|
||||
},
|
||||
"upsertFile": func(context, arg interface{}, err error) {
|
||||
context.(func(msg string))(arg.(string))
|
||||
},
|
||||
}
|
||||
|
||||
func IndexRepo(message string) (err error) {
|
||||
if 1 > len(Conf.Repo.Key) {
|
||||
err = errors.New("repo key is nil")
|
||||
|
|
@ -61,6 +73,7 @@ func IndexRepo(message string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
_, err = repo.Index(message)
|
||||
_, err = repo.Index(message, util.PushEndlessProgress, indexCallbacks)
|
||||
util.PushClearProgress()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue