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
|
|
@ -173,9 +173,7 @@ func BuildTheme(i Importer, tdir string) (th *fic.Theme, errs []string) {
|
|||
}
|
||||
|
||||
// SyncThemes imports new or updates existing themes.
|
||||
func SyncThemes(i Importer) []string {
|
||||
var errs []string
|
||||
|
||||
func SyncThemes(i Importer) (errs []string) {
|
||||
if themes, err := GetThemes(i); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
} else {
|
||||
|
|
@ -233,7 +231,7 @@ func SyncThemes(i Importer) []string {
|
|||
}
|
||||
}
|
||||
|
||||
return errs
|
||||
return
|
||||
}
|
||||
|
||||
// ApiListRemoteThemes is an accessor letting foreign packages to access remote themes list.
|
||||
|
|
|
|||
Reference in a new issue