admin/sync: avoid error when no depends.txt exists

This commit is contained in:
nemunaire 2018-01-06 18:03:11 +01:00
parent 24f527ab8a
commit 57758cd018

View file

@ -127,6 +127,11 @@ func SyncExercices(i Importer, theme fic.Theme) []string {
dmap_keys = append(dmap_keys, fmt.Sprintf("%d", k))
}
for _, e := range dmap {
// No error if the file doesn't exist
if ! i.exists(path.Join(e.Path, "depends.txt")) {
continue
}
// Treat depends.txt
if depends, err := getFileContent(i, path.Join(e.Path, "depends.txt")); err != nil {
errs = append(errs, fmt.Sprintf("%q: depends.txt: %s", path.Base(e.Path), err))