diff --git a/admin/sync/exercice_files.go b/admin/sync/exercice_files.go index 8f9d4806..fe37eba1 100644 --- a/admin/sync/exercice_files.go +++ b/admin/sync/exercice_files.go @@ -60,7 +60,7 @@ func BuildFilesListInto(i Importer, exercice *fic.Exercice, into string) (files // Parse DIGESTS.txt if digs, err := GetFileContent(i, path.Join(exercice.Path, into, "DIGESTS.txt")); err != nil { errs = multierr.Append(errs, NewExerciceError(exercice, fmt.Errorf("unable to read %s: %w", path.Join(into, "DIGESTS.txt"), err))) - } else { + } else if len(digs) > 0 { digests = map[string][]byte{} for nline, d := range strings.Split(digs, "\n") { if dsplt := strings.SplitN(d, " ", 2); len(dsplt) < 2 { diff --git a/admin/sync/file.go b/admin/sync/file.go index 4f720e91..59b1ec6e 100644 --- a/admin/sync/file.go +++ b/admin/sync/file.go @@ -172,10 +172,6 @@ func GetFileContent(i Importer, URI string) (string, error) { buf = append(buf, b) } - if len(buf) == 0 { - return "", fmt.Errorf("File is empty") - } - return strings.TrimSpace(string(buf)), nil } }