admin/sync: avoid error when no depends.txt exists
This commit is contained in:
parent
24f527ab8a
commit
57758cd018
1 changed files with 5 additions and 0 deletions
|
@ -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))
|
||||
|
|
Reference in a new issue