admin: localimporter can make symlink instead of copying whole files
This commit is contained in:
parent
ad5ea6801e
commit
17dd69ac30
5 changed files with 63 additions and 24 deletions
|
@ -15,11 +15,11 @@ func SyncExerciceHints(i Importer, exercice fic.Exercice) []string {
|
|||
} else if hints, err := i.listDir(path.Join(exercice.Path, "hints")); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
} else {
|
||||
for _, hfile := range hints {
|
||||
for n, hfile := range hints {
|
||||
if hint_cnt, err := getFileContent(i, path.Join(exercice.Path, "hints", hfile)); err != nil {
|
||||
errs = append(errs, fmt.Sprintf("%q: unable to read hint file %q: %s", path.Base(exercice.Path), hfile, err))
|
||||
continue
|
||||
} else if _, err := exercice.AddHint(hfile, hint_cnt, 1); err != nil {
|
||||
} else if _, err := exercice.AddHint(fmt.Sprintf("Indice #%d", n + 1), hint_cnt, 1); err != nil {
|
||||
errs = append(errs, fmt.Sprintf("%q: unable to add hint %q: %s", path.Base(exercice.Path), hfile, err))
|
||||
continue
|
||||
}
|
||||
|
|
Reference in a new issue