mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 00:12:11 +08:00
create database file when file not exists
This commit is contained in:
@@ -293,12 +293,7 @@ func loadDatabaseConfiguration(config *Config, configFile *ini.File, sectionName
|
||||
|
||||
if dbConfig.DatabaseType == DBTYPE_SQLITE3 {
|
||||
staticDBPath := getConfigItemStringValue(configFile, sectionName, "db_path")
|
||||
finalStaticDBPath, err := getFinalPath(config.WorkingPath, staticDBPath)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
finalStaticDBPath, _ := getFinalPath(config.WorkingPath, staticDBPath)
|
||||
dbConfig.DatabasePath = finalStaticDBPath
|
||||
}
|
||||
|
||||
@@ -397,7 +392,7 @@ func getFinalPath(workingPath, p string) (string, error) {
|
||||
return p, nil
|
||||
}
|
||||
|
||||
return "", err
|
||||
return p, err
|
||||
}
|
||||
|
||||
func getConfigItemStringValue(configFile *ini.File, sectionName string, itemName string, defaultValue ...string) string {
|
||||
|
||||
Reference in New Issue
Block a user