aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2021-05-04 17:14:09 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2021-05-04 17:14:09 +0100
commite4ad2af0ec47859864e4e851395bea511d25be54 (patch)
tree9fb81a47d405aa16138a861997bc9d25a8aa4572
parent47415cc7e9ff17016264982ce3d7de3fd907dba7 (diff)
Now the checkdb func is working
-rw-r--r--datamaps/config.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/datamaps/config.go b/datamaps/config.go
index 590e07d..dc27587 100644
--- a/datamaps/config.go
+++ b/datamaps/config.go
@@ -66,13 +66,13 @@ func NewDBPathChecker(h getUserConfigDir) *DBPathChecker {
// Check returns true if the necessary config files (including
// the database) are in place - false if not
func (db *DBPathChecker) Check() bool {
- println("In Check() method")
userConfig, err := db.userConfig()
if err != nil {
log.Fatal(err)
}
- dbPath := filepath.Join(userConfig, "datamaps.db")
+ dbPath := filepath.Join(userConfig, "datamaps", "datamaps.db")
if _, err := os.Stat(dbPath); os.IsNotExist(err) {
+ println("Seems that " + dbPath + " not there")
return false
}
return true
@@ -221,9 +221,11 @@ func nextString(args []string, i *int, message string) string {
func processOptions(opts *Options, allArgs []string) {
if len(allArgs) == 0 {
- allArgs = append(allArgs, "checkdb")
+ allArgs = append(allArgs, "help")
}
switch allArgs[0] {
+ case "checkdb":
+ opts.Command = "checkdb"
case "import":
opts.Command = "import"
case "help":