core: Config path is a file, not a directory

This commit is contained in:
John Brooks 2016-11-05 16:48:54 -06:00
parent f0c4c5afcd
commit 569a138e21
1 changed files with 2 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
"path/filepath"
"sync" "sync"
) )
@ -14,7 +13,6 @@ import (
// an automatic import function. // an automatic import function.
type Config struct { type Config struct {
path string
filePath string filePath string
root ConfigRoot root ConfigRoot
@ -52,10 +50,9 @@ type ConfigIdentity struct {
ServiceKey string ServiceKey string
} }
func LoadConfig(configPath string) (*Config, error) { func LoadConfig(filePath string) (*Config, error) {
config := &Config{ config := &Config{
path: configPath, filePath: filePath,
filePath: filepath.Join(configPath, "ricochet.json"),
} }
data, err := ioutil.ReadFile(config.filePath) data, err := ioutil.ReadFile(config.filePath)
@ -69,7 +66,6 @@ func LoadConfig(configPath string) (*Config, error) {
return nil, err return nil, err
} }
log.Printf("Config: %v", config.root)
return config, nil return config, nil
} }