fix: root

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2019-01-08 14:43:46 +00:00
parent 68bdf65595
commit 88644664e4

View File

@ -131,6 +131,10 @@ user created with the credentials from options "username" and "password".`,
server := getServerWithViper(cmd.Flags(), d.store) server := getServerWithViper(cmd.Flags(), d.store)
setupLog(server.Log) setupLog(server.Log)
root, err := filepath.Abs(server.Root)
checkErr(err)
server.Root = root
handler, err := fbhttp.NewHandler(d.store, server) handler, err := fbhttp.NewHandler(d.store, server)
checkErr(err) checkErr(err)
@ -159,9 +163,7 @@ func getServerWithViper(flags *pflag.FlagSet, st *storage.Storage) *settings.Ser
checkErr(err) checkErr(err)
if val, set := getStringViperFlag(flags, "root"); set { if val, set := getStringViperFlag(flags, "root"); set {
root, err := filepath.Abs(val) server.Root = val
checkErr(err)
server.Root = root
} }
if val, set := getStringViperFlag(flags, "baseurl"); set { if val, set := getStringViperFlag(flags, "baseurl"); set {