Prepend environment path to database path

This fixes an error when the `ENV_SHIORI_DB` is defined, it doesn't open a database file because the database file name isn't on the `databasePath` variable.
This commit is contained in:
Abe Estrada 2018-03-05 17:00:07 -07:00 committed by GitHub
parent d167379546
commit 61fbe8fc8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ import (
func main() {
databasePath := "shiori.db"
if value, found := os.LookupEnv("ENV_SHIORI_DB"); found {
databasePath = value
databasePath = value + "/" + databasePath
}
sqliteDB, err := db.OpenSQLiteDatabase(databasePath)