shiori/main.go

30 lines
491 B
Go
Raw Normal View History

2018-02-23 17:51:06 +08:00
//go:generate fileb0x filebox.json
2018-01-26 18:40:01 +08:00
package main
import (
2018-03-05 08:14:58 +08:00
"os"
"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-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
cmd.Execute()
2018-03-05 08:14:58 +08:00
}
func checkError(err error) {
if err != nil {
panic(err)
}
}