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:
parent
281056a723
commit
aebfb7bf96
7 changed files with 62 additions and 6 deletions
|
|
@ -243,6 +243,12 @@ func SyncExercice(i Importer, theme fic.Theme, epath string, dmap *map[int64]fic
|
|||
|
||||
// SyncExercices imports new or updates existing exercices, in a given theme.
|
||||
func SyncExercices(i Importer, theme fic.Theme) (errs []string) {
|
||||
if !avoidImporterSync() {
|
||||
if err := i.Sync(); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if exercices, err := GetExercices(i, theme); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
} else {
|
||||
|
|
|
|||
Reference in a new issue