1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Writes database in current directory

This commit is contained in:
Zack Scholl 2016-02-15 17:11:07 -05:00
parent f934edc757
commit 3c53546c48

View File

@ -5,6 +5,7 @@ import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
"runtime"
@ -38,7 +39,8 @@ var VersionNum string
func main() {
VersionNum = "1.1"
_, executableFile, _, _ := runtime.Caller(0) // get full path of this file
databaseFile := path.Join(path.Dir(executableFile), "data.db")
cwd, _ := os.Getwd()
databaseFile := path.Join(cwd, "data.db")
flag.StringVar(&RuntimeArgs.Port, "p", ":8003", "port to bind")
flag.StringVar(&RuntimeArgs.DatabaseLocation, "db", databaseFile, "location of database file")
flag.StringVar(&RuntimeArgs.AdminKey, "a", RandStringBytesMaskImprSrc(50), "key to access admin priveleges")