Skip to content

Commit

Permalink
add db-path query
Browse files Browse the repository at this point in the history
  • Loading branch information
1ntEgr8 committed Apr 28, 2021
1 parent 6c9ea0c commit 52cf16b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.go
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"log"
"net/http"
"os"
"os/exec"
"runtime"

Expand All @@ -18,9 +19,18 @@ func main() {
headless := flag.Bool("headless", false, "run server in headless mode")
port := flag.Int("port", 8080, "which port to run server on")
client := flag.String("client-path", "client/public", "path to client")
dbPath := flag.Bool("db-path", false, "prints path to sources db")
flag.Parse()

Serve(*client, *port, *headless)
if *dbPath {
pwd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
fmt.Printf(fmt.Sprintf("%s/sources.db", pwd))
} else {
Serve(*client, *port, *headless)
}
}

func ConnectDB() *gorm.DB {
Expand Down

0 comments on commit 52cf16b

Please sign in to comment.