sync: Add Init and Sync functions

Init initializes the directory/repository before the first use.
Sync is called to unsure the directory is up-to-date.
This commit is contained in:
nemunaire 2021-10-26 19:56:40 +02:00
parent 281056a723
commit aebfb7bf96
7 changed files with 62 additions and 6 deletions

View file

@ -128,6 +128,9 @@ func main() {
sync.GlobalImporter, _ = sync.NewCloudImporter(cloudDAVBase, cloudUsername, cloudPassword)
}
if sync.GlobalImporter != nil {
if err := sync.GlobalImporter.Init(); err != nil {
log.Fatal("Unable to initialize the importer:", err)
}
log.Println("Using", sync.GlobalImporter.Kind())
}