sync: handle new sync format: filenames and locations

This commit is contained in:
Thibaut 2018-05-12 02:01:49 +02:00 committed by Pierre-Olivier Mercier
commit d303ecfa38
4 changed files with 14 additions and 33 deletions

View file

@ -50,8 +50,8 @@ func SyncThemes(i Importer) []string {
if authors, err = getAuthors(i, tname); err != nil {
errs = append(errs, fmt.Sprintf("%q: unable to get AUTHORS: %s", tname, err))
continue
} else if intro, err = getFileContent(i, path.Join(tname, "introduction.txt")); err != nil {
errs = append(errs, fmt.Sprintf("%q: unable to get introduction: %s", tname, err))
} else if intro, err = getFileContent(i, path.Join(tname, "overview.txt")); err != nil {
errs = append(errs, fmt.Sprintf("%q: unable to get theme's overview: %s", tname, err))
} else if theme, err = fic.GetThemeByName(tname); err != nil {
if _, err := fic.CreateTheme(tname, fic.ToURLid(tname), strings.Join(authors, ", "), intro); err != nil {
errs = append(errs, fmt.Sprintf("%q: an error occurs during add: %s", tname, err))