2018-04-28 22:02:36 +08:00
|
|
|
//go:generate go run assets-generator.go
|
|
|
|
|
2018-01-26 18:40:01 +08:00
|
|
|
package main
|
|
|
|
|
2018-01-28 14:55:43 +08:00
|
|
|
import (
|
|
|
|
"github.com/RadhiFadlillah/shiori/cmd"
|
2018-04-28 22:02:36 +08:00
|
|
|
dt "github.com/RadhiFadlillah/shiori/database"
|
2018-03-05 08:14:58 +08:00
|
|
|
_ "github.com/mattn/go-sqlite3"
|
2018-05-01 11:12:55 +08:00
|
|
|
"github.com/sirupsen/logrus"
|
2018-01-28 14:55:43 +08:00
|
|
|
)
|
2018-01-26 18:40:01 +08:00
|
|
|
|
2018-05-01 11:23:38 +08:00
|
|
|
var dbPath = "shiori.db"
|
2018-03-05 08:14:58 +08:00
|
|
|
|
2018-05-01 11:23:38 +08:00
|
|
|
func main() {
|
2018-05-01 11:12:55 +08:00
|
|
|
// Open database
|
|
|
|
sqliteDB, err := dt.OpenSQLiteDatabase(dbPath)
|
2018-03-05 08:14:58 +08:00
|
|
|
checkError(err)
|
|
|
|
|
2018-05-01 11:12:55 +08:00
|
|
|
// Start cmd
|
2018-04-28 22:02:36 +08:00
|
|
|
shioriCmd := cmd.NewShioriCmd(sqliteDB)
|
|
|
|
if err := shioriCmd.Execute(); err != nil {
|
|
|
|
logrus.Fatalln(err)
|
|
|
|
}
|
2018-03-05 08:14:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func checkError(err error) {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|