2018-02-23 17:51:06 +08:00
|
|
|
//go:generate fileb0x filebox.json
|
2018-01-26 18:40:01 +08:00
|
|
|
package main
|
|
|
|
|
2018-01-28 14:55:43 +08:00
|
|
|
import (
|
2018-03-05 08:14:58 +08:00
|
|
|
"os"
|
|
|
|
|
2018-01-28 14:55:43 +08:00
|
|
|
"github.com/RadhiFadlillah/shiori/cmd"
|
2018-03-05 08:14:58 +08:00
|
|
|
db "github.com/RadhiFadlillah/shiori/database"
|
|
|
|
_ "github.com/mattn/go-sqlite3"
|
2018-01-28 14:55:43 +08:00
|
|
|
)
|
2018-01-26 18:40:01 +08:00
|
|
|
|
|
|
|
func main() {
|
2018-03-05 08:14:58 +08:00
|
|
|
databasePath := "shiori.db"
|
|
|
|
if value, found := os.LookupEnv("ENV_SHIORI_DB"); found {
|
|
|
|
databasePath = value
|
|
|
|
}
|
|
|
|
|
|
|
|
sqliteDB, err := db.OpenSQLiteDatabase(databasePath)
|
|
|
|
checkError(err)
|
|
|
|
|
|
|
|
cmd.DB = sqliteDB
|
2018-01-28 14:55:43 +08:00
|
|
|
cmd.Execute()
|
2018-03-05 08:14:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func checkError(err error) {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|