Move cache to ~/.cache/gomuks by default. Fixes #39
This commit is contained in:
parent
cc929ba899
commit
d8dba100e0
@ -38,11 +38,11 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewConfig creates a config that loads data from the given directory.
|
// NewConfig creates a config that loads data from the given directory.
|
||||||
func NewConfig(dir string) *Config {
|
func NewConfig(configDir, cacheDir string) *Config {
|
||||||
return &Config{
|
return &Config{
|
||||||
Dir: dir,
|
Dir: configDir,
|
||||||
HistoryDir: filepath.Join(dir, "history"),
|
HistoryDir: filepath.Join(cacheDir, "history"),
|
||||||
MediaDir: filepath.Join(dir, "media"),
|
MediaDir: filepath.Join(cacheDir, "media"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,11 +41,12 @@ type Gomuks struct {
|
|||||||
// but does not start it.
|
// but does not start it.
|
||||||
func NewGomuks(uiProvider ifc.UIProvider) *Gomuks {
|
func NewGomuks(uiProvider ifc.UIProvider) *Gomuks {
|
||||||
configDir := filepath.Join(os.Getenv("HOME"), ".config/gomuks")
|
configDir := filepath.Join(os.Getenv("HOME"), ".config/gomuks")
|
||||||
|
cacheDir := filepath.Join(os.Getenv("HOME"), ".cache/gomuks")
|
||||||
gmx := &Gomuks{
|
gmx := &Gomuks{
|
||||||
stop: make(chan bool, 1),
|
stop: make(chan bool, 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
gmx.config = config.NewConfig(configDir)
|
gmx.config = config.NewConfig(configDir, cacheDir)
|
||||||
gmx.ui = uiProvider(gmx)
|
gmx.ui = uiProvider(gmx)
|
||||||
gmx.matrix = matrix.NewContainer(gmx)
|
gmx.matrix = matrix.NewContainer(gmx)
|
||||||
gmx.ui.Init()
|
gmx.ui.Init()
|
||||||
|
Loading…
Reference in New Issue
Block a user