sync: Allow exercice directory to do not have identifier

This commit is contained in:
nemunaire 2023-07-09 10:31:54 +02:00
parent 6fd1856dd9
commit edbb867f62

View File

@ -102,8 +102,11 @@ func BuildExercice(i Importer, theme *fic.Theme, epath string, dmap *map[int64]*
var err error
eid, e.Title, err = parseExerciceDirname(edir)
if err != nil {
errs = append(errs, NewExerciceError(e, fmt.Errorf("unable to parse exercice directory: %w", err), theme))
return nil, p, eid, edir, errs
// Ignore eid if we are certain this is an exercice directory, eid will be 0
if !i.Exists(path.Join(epath, "title.txt")) {
errs = append(errs, NewExerciceError(e, fmt.Errorf("unable to parse exercice directory: %w", err), theme))
return nil, p, eid, edir, errs
}
}
// Get exceptions