diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-07-25 18:43:35 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-07-25 18:43:35 +0100 |
commit | 6663dc215c9b8274a947e6055ba337036f0cb772 (patch) | |
tree | 42c3899c8c4fd4a194e5fa726926e7dd5c6170e6 /pkg/datamaps/config.go | |
parent | 278eef90bffce6066a98a996a1462acd96b21d4e (diff) |
improvement
Diffstat (limited to 'pkg/datamaps/config.go')
-rw-r--r-- | pkg/datamaps/config.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/datamaps/config.go b/pkg/datamaps/config.go index 8dc8896..6635761 100644 --- a/pkg/datamaps/config.go +++ b/pkg/datamaps/config.go @@ -1,7 +1,6 @@ package datamaps import ( - "fmt" "log" "os" "path/filepath" @@ -32,14 +31,13 @@ func NewDBPathChecker(h GetUserConfigDir) *DBPathChecker { return &DBPathChecker{getUserConfigDir: h} } -func (db *DBPathChecker) check() bool { +func (db *DBPathChecker) Check() bool { userConfig, err := db.getUserConfigDir() if err != nil { log.Fatal(err) } dbPath := filepath.Join(userConfig, "datamaps.db") if _, err := os.Stat(dbPath); os.IsNotExist(err) { - fmt.Fprintf(os.Stderr, "db does not exist\n") return false } return true @@ -57,7 +55,7 @@ func SetUp() (string, error) { if _, err := os.Stat(configPath); os.IsNotExist(err) { log.Println("Config directory does not exist.") log.Printf("Creating config directory %s\n", configPath) - if err := os.Mkdir(filepath.Join(dir, "datamaps-go"), 0700); err != nil { + if err := os.Mkdir(filepath.Join(dir, "datamaps"), 0700); err != nil { return "", err } } else { |