Skip to content

Commit

Permalink
refactor: clean up initDB function
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoksr committed Jun 1, 2020
1 parent f98381c commit a8770b8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/proji/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ func initConfig() {
}

func initStorageService() {
dbPath := viper.GetString("sqlite3.path")
var err error
projiEnv.Svc, err = sqlite.New(filepath.Join(projiEnv.UserConfigPath, dbPath))
projiEnv.Svc, err = sqlite.New(projiEnv.DBPath)
if err != nil {
log.Fatalf("Error: could not connect to sqlite db. %v\n%s\n", err, projiEnv.UserConfigPath)
log.Fatalf("Error: could not connect to sqlite db. %v\n%s\n", err, projiEnv.DBPath)
}
}

0 comments on commit a8770b8

Please sign in to comment.