saveGameTimeFile writes the current gameTimeData to the gametime.yaml path.
()
| 84 | |
| 85 | // saveGameTimeFile writes the current gameTimeData to the gametime.yaml path. |
| 86 | func saveGameTimeFile() error { |
| 87 | path := string(configs.GetFilePathsConfig().DataFiles) + `/gametime.yaml` |
| 88 | |
| 89 | data, err := yaml.Marshal(&gameTimeData) |
| 90 | if err != nil { |
| 91 | return errors.Wrap(err, "marshal gametime data") |
| 92 | } |
| 93 | |
| 94 | if err := util.WriteFile(path, data, 0o644); err != nil { |
| 95 | return errors.Wrap(err, "write gametime.yaml: "+path) |
| 96 | } |
| 97 | |
| 98 | return nil |
| 99 | } |
no test coverage detected