feat(GODT-2709): Init Configuration status.

This commit is contained in:
Romain LE JEUNE
2023-06-27 08:42:47 +02:00
parent 12f9fb03c3
commit b77512dfd9
10 changed files with 233 additions and 1 deletions

View File

@ -188,6 +188,16 @@ func (l *Locations) ProvideUpdatesPath() (string, error) {
return l.getUpdatesPath(), nil
}
// ProvideStatsPath returns a location for statistics files (e.g. ~/.local/share/<company>/<app>/stats).
// It creates it if it doesn't already exist.
func (l *Locations) ProvideStatsPath() (string, error) {
if err := os.MkdirAll(l.getStatsPath(), 0o700); err != nil {
return "", err
}
return l.getStatsPath(), nil
}
func (l *Locations) getGluonCachePath() string {
return filepath.Join(l.userData, "gluon")
}
@ -216,6 +226,10 @@ func (l *Locations) getUpdatesPath() string {
return filepath.Join(l.userData, "updates")
}
func (l *Locations) getStatsPath() string {
return filepath.Join(l.userData, "stats")
}
// Clear removes everything except the lock and update files.
func (l *Locations) Clear(except ...string) error {
return files.Remove(