Removed 'get' prefix from DataDir() and ConfigDir()
This commit is contained in:
parent
c8a1e3e105
commit
db27a22347
@ -20,7 +20,7 @@ type Config struct {
|
||||
} `yaml:"chroma"`
|
||||
}
|
||||
|
||||
func getConfigDir() string {
|
||||
func ConfigDir() string {
|
||||
var configDir string
|
||||
|
||||
xdgConfigHome := os.Getenv("XDG_CONFIG_HOME")
|
||||
@ -36,7 +36,7 @@ func getConfigDir() string {
|
||||
}
|
||||
|
||||
func NewConfig() (*Config, error) {
|
||||
configFile := filepath.Join(getConfigDir(), "config.yaml")
|
||||
configFile := filepath.Join(ConfigDir(), "config.yaml")
|
||||
shouldWriteDefaults := false
|
||||
c := &Config{}
|
||||
|
||||
|
@ -33,7 +33,7 @@ type Conversation struct {
|
||||
Title string
|
||||
}
|
||||
|
||||
func getDataDir() string {
|
||||
func DataDir() string {
|
||||
var dataDir string
|
||||
|
||||
xdgDataHome := os.Getenv("XDG_DATA_HOME")
|
||||
@ -49,7 +49,7 @@ func getDataDir() string {
|
||||
}
|
||||
|
||||
func NewStore() (*Store, error) {
|
||||
databaseFile := filepath.Join(getDataDir(), "conversations.db")
|
||||
databaseFile := filepath.Join(DataDir(), "conversations.db")
|
||||
db, err := gorm.Open(sqlite.Open(databaseFile), &gorm.Config{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error establishing connection to store: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user