diff --git a/admin/main.go b/admin/main.go index 1d9dc58d..9db71dad 100644 --- a/admin/main.go +++ b/admin/main.go @@ -130,6 +130,7 @@ func main() { if StaticDir, err = filepath.Abs(StaticDir); err != nil { log.Fatal(err) } + sync.DeepReportPath = path.Join(StaticDir, sync.DeepReportPath) if fic.FilesDir, err = filepath.Abs(fic.FilesDir); err != nil { log.Fatal(err) } diff --git a/admin/sync/full.go b/admin/sync/full.go index 5c6f0d09..0b5fb6ae 100644 --- a/admin/sync/full.go +++ b/admin/sync/full.go @@ -12,6 +12,9 @@ import ( "srs.epita.fr/fic-server/settings" ) +// DeepReportPath stores the path to the report generated during full recursive import. +var DeepReportPath = "full_import_report.json" + // oneDeepSync ensure there is no more than one running deep sync. var oneDeepSync sync.Mutex @@ -43,7 +46,7 @@ func SyncDeep(i Importer) (errs map[string][]string) { errs["_regeneration"] = []string{} - if fdto, err := os.Create("../htdocs-admin/full_import_report.json"); err == nil { + if fdto, err := os.Create(DeepReportPath); err == nil { defer fdto.Close() fdto.Write([]byte("disp("))