admin/sync: remove old exercices no more in tree
This commit is contained in:
parent
a89de24ad0
commit
d965aab14a
|
@ -2,6 +2,7 @@ package sync
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"path"
|
||||
"strings"
|
||||
"strconv"
|
||||
|
@ -84,6 +85,19 @@ func SyncExercices(i Importer, theme fic.Theme) []string {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove old exercices
|
||||
if exercices, err := theme.GetExercices(); err == nil {
|
||||
log.Println(emap)
|
||||
for _, ex := range exercices {
|
||||
if _, ok := emap[ex.Title]; !ok {
|
||||
log.Println(ok)
|
||||
ex.Delete()
|
||||
} else {
|
||||
log.Println(ok)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return errs
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user