GODT-976 Exclude updates from clearing cache and clear cache, including updates, while switching early access off

This commit is contained in:
Michal Horejsek
2021-01-27 09:16:04 +01:00
parent c6107dbd4b
commit 7468ed7dc0
18 changed files with 241 additions and 13 deletions

View File

@ -165,12 +165,20 @@ func (l *Locations) getUpdatesPath() string {
return filepath.Join(l.userCache, "updates")
}
// Clear removes everything except the lock file.
// Clear removes everything except the lock and update files.
func (l *Locations) Clear() error {
return files.Remove(
l.getSettingsPath(),
l.getLogsPath(),
l.getCachePath(),
).Except(
l.getUpdatesPath(),
).Do()
}
// ClearUpdates removes update files.
func (l *Locations) ClearUpdates() error {
return files.Remove(
l.getUpdatesPath(),
).Do()
}