1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

Support any name database

Closes #264
This commit is contained in:
sauls8t 2019-05-10 16:38:19 +01:00
parent 86d25b2191
commit 8ab3cbe7e8
4 changed files with 2 additions and 45 deletions

5
core/env/parser.go vendored
View file

@ -51,7 +51,6 @@ func configFile() (f Flags, ok bool) {
var configFile string
// First argument is always program being executed.
// No additional arguments means check for documize.conf file.
if len(os.Args) == 1 {
// No arguments, so we default to default config filename.
@ -72,14 +71,12 @@ func configFile() (f Flags, ok bool) {
// Tell caller where the config came from.
f.ConfigSource = configFile
// So now we have file and we parse the TOML format.
// We parse the TOML format config file.
var ct ConfigToml
if _, err := toml.DecodeFile(configFile, &ct); err != nil {
fmt.Println(err)
return
}
// TOML format cofig file is good so we map to flags.
f.DBType = strings.ToLower(ct.Database.Type)
f.DBConn = ct.Database.Connection
f.Salt = ct.Database.Salt