aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/datamaps/config.go
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-07-25 18:43:35 +0100
committerMatthew Lemon <matt@matthewlemon.com>2020-07-25 18:43:35 +0100
commit6663dc215c9b8274a947e6055ba337036f0cb772 (patch)
tree42c3899c8c4fd4a194e5fa726926e7dd5c6170e6 /pkg/datamaps/config.go
parent278eef90bffce6066a98a996a1462acd96b21d4e (diff)
improvement
Diffstat (limited to 'pkg/datamaps/config.go')
-rw-r--r--pkg/datamaps/config.go6
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 {