GODT-2229: Allow changing cache folder to a non-empty folder.

This commit is contained in:
Romain Le Jeune
2023-01-10 16:40:52 +00:00
parent 407c9fe1a6
commit b19e16e4b8
15 changed files with 187 additions and 63 deletions

View File

@ -148,6 +148,17 @@ func (l *Locations) ProvideGluonPath() (string, error) {
return l.getGluonPath(), nil
}
// ProvideGluonDatabasePath returns a location for gluon database.
// It creates it if it doesn't already exist.
func (l *Locations) ProvideGluonDatabasePath() (string, error) {
dbPath := filepath.Join(l.userData, "gluonDB")
if err := os.MkdirAll(dbPath, 0o700); err != nil {
return "", err
}
return dbPath, nil
}
// ProvideLogsPath returns a location for user logs (e.g. ~/.local/share/<company>/<app>/logs).
// It creates it if it doesn't already exist.
func (l *Locations) ProvideLogsPath() (string, error) {