backend: Also generate scores.json for each team
This commit is contained in:
parent
bfdb1c2bf7
commit
46d1bb21f7
1 changed files with 9 additions and 1 deletions
|
@ -116,7 +116,7 @@ func genTeamIssuesFile(team *fic.Team) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Generate my.json and wait.json for a given team
|
||||
// Generate my.json, wait.json and scores.json for a given team
|
||||
func genTeamMyFile(team *fic.Team) error {
|
||||
dirPath := path.Join(TeamsDir, fmt.Sprintf("%d", team.Id))
|
||||
|
||||
|
@ -143,6 +143,14 @@ func genTeamMyFile(team *fic.Team) error {
|
|||
} else if err = ioutil.WriteFile(path.Join(dirPath, "wait.json"), j, 0666); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if scores, err := team.ScoreGrid(); err != nil {
|
||||
return err
|
||||
} else if j, err := json.Marshal(scores); err != nil {
|
||||
return err
|
||||
} else if err = ioutil.WriteFile(path.Join(dirPath, "scores.json"), j, 0666); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Reference in a new issue