mirror of
https://github.com/go-shiori/shiori.git
synced 2024-11-15 05:34:45 +08:00
29 lines
491 B
Go
29 lines
491 B
Go
//go:generate fileb0x filebox.json
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/RadhiFadlillah/shiori/cmd"
|
|
db "github.com/RadhiFadlillah/shiori/database"
|
|
_ "github.com/mattn/go-sqlite3"
|
|
)
|
|
|
|
func main() {
|
|
databasePath := "shiori.db"
|
|
if value, found := os.LookupEnv("ENV_SHIORI_DB"); found {
|
|
databasePath = value
|
|
}
|
|
|
|
sqliteDB, err := db.OpenSQLiteDatabase(databasePath)
|
|
checkError(err)
|
|
|
|
cmd.DB = sqliteDB
|
|
cmd.Execute()
|
|
}
|
|
|
|
func checkError(err error) {
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|