diff --git a/admin/sync/exercice_files.go b/admin/sync/exercice_files.go index ee676993..ee6de6cd 100644 --- a/admin/sync/exercice_files.go +++ b/admin/sync/exercice_files.go @@ -71,12 +71,14 @@ func SyncExerciceFiles(i Importer, exercice fic.Exercice) (errs []string) { continue } - if _, err := i.importFile(path.Join(exercice.Path, "files", fname), + if f, err := i.importFile(path.Join(exercice.Path, "files", fname), func(filePath string, origin string) (interface{}, error) { return exercice.ImportFile(filePath, origin, digests[fname]) }); err != nil { errs = append(errs, fmt.Sprintf("%q: unable to import file %q: %s", path.Base(exercice.Path), fname, err)) continue + } else if f.(fic.EFile).Size == 0 { + errs = append(errs, fmt.Sprintf("%q: WARNING imported file %q is empty!", path.Base(exercice.Path), fname)) } } }