From 6ab877994830602ff86a93657b366660a0d81825 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 8 Jan 2019 14:43:46 +0000 Subject: [PATCH] fix: root License: MIT Signed-off-by: Henrique Dias Former-commit-id: fc5ff2d807b0b8c6857c71311f061c7322af32df [formerly 19bd77dbaf743c53e7c8db08930e2a9ce6c0b675] [formerly 89f54b49d9d705b9a016827ceb1e7c0face0e56b [formerly 88644664e42d5a327e8bab097375e36b01d44c95]] Former-commit-id: 3ff15179a86d330ff5f2a7f6b49b890d3ecd34fd [formerly 483a8a99b3b9dbe13ded1cf7fd608bf27b35a4d0] Former-commit-id: 8115bd29a2356de1dd1cc2950248c4a3c07580e4 --- cmd/root.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 25ce85b3..b662e2a2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -131,6 +131,10 @@ user created with the credentials from options "username" and "password".`, server := getServerWithViper(cmd.Flags(), d.store) setupLog(server.Log) + root, err := filepath.Abs(server.Root) + checkErr(err) + server.Root = root + handler, err := fbhttp.NewHandler(d.store, server) checkErr(err) @@ -159,9 +163,7 @@ func getServerWithViper(flags *pflag.FlagSet, st *storage.Storage) *settings.Ser checkErr(err) if val, set := getStringViperFlag(flags, "root"); set { - root, err := filepath.Abs(val) - checkErr(err) - server.Root = root + server.Root = val } if val, set := getStringViperFlag(flags, "baseurl"); set {