Compare commits

...

2 Commits

Author SHA1 Message Date
e772ecf2ab Fix database presence check
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-01-11 18:31:57 -08:00
3e0c110893 Warn user if DB does not have version 2023-01-11 18:31:08 -08:00
2 changed files with 3 additions and 2 deletions

View File

@ -71,6 +71,6 @@ func init() {
DBPath = filepath.Join(CacheDir, "db")
_, err = os.ReadDir(DBPath)
DBPresent = err == nil
fi, err := os.Stat(DBPath)
DBPresent = err == nil && !fi.IsDir()
}

View File

@ -107,6 +107,7 @@ func Init(db *sqlx.DB, dsn string) error {
ver, ok := GetVersion(db)
if !ok {
log.Warn("Database version does not exist. Run lure fix if something isn't working.").Send()
return addVersion(db, CurrentVersion)
}