mirror of
https://github.com/go-shiori/shiori.git
synced 2025-01-31 12:18:30 +08:00
Merge branch 'master' into tagcloud
This commit is contained in:
commit
aebdf7ca27
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -3,6 +3,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
fp "path/filepath"
|
||||||
|
|
||||||
"github.com/RadhiFadlillah/shiori/cmd"
|
"github.com/RadhiFadlillah/shiori/cmd"
|
||||||
db "github.com/RadhiFadlillah/shiori/database"
|
db "github.com/RadhiFadlillah/shiori/database"
|
||||||
|
@ -12,6 +13,11 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
databasePath := "shiori.db"
|
databasePath := "shiori.db"
|
||||||
if value, found := os.LookupEnv("ENV_SHIORI_DB"); found {
|
if value, found := os.LookupEnv("ENV_SHIORI_DB"); found {
|
||||||
|
// If ENV_SHIORI_DB is directory, append "shiori.db" as filename
|
||||||
|
if f1, err := os.Stat(value); err == nil && f1.IsDir() {
|
||||||
|
value = fp.Join(value, "shiori.db")
|
||||||
|
}
|
||||||
|
|
||||||
databasePath = value
|
databasePath = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue