From c7ffaad763f2ac9f120844c3677714b4ff6010ad Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 12 Feb 2020 21:00:07 +0100 Subject: [PATCH] Expand "repo" string before logging Signed-off-by: Jakub Sztandera --- cmd/lotus/daemon.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index 7f8806e6f..d7f431d2e 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -11,6 +11,7 @@ import ( paramfetch "github.com/filecoin-project/go-paramfetch" "github.com/filecoin-project/go-sectorbuilder" blockstore "github.com/ipfs/go-ipfs-blockstore" + "github.com/mitchellh/go-homedir" "github.com/multiformats/go-multiaddr" "golang.org/x/xerrors" "gopkg.in/urfave/cli.v2" @@ -90,7 +91,15 @@ var DaemonCmd = &cli.Command{ } ctx := context.Background() - log.Infof("lotus repo: %s", cctx.String("repo")) + { + dir, err := homedir.Expand(cctx.String("repo")) + if err != nil { + log.Warnw("could not expand repo location", "error", err) + } else { + log.Infof("lotus repo: %s", dir) + } + } + r, err := repo.NewFS(cctx.String("repo")) if err != nil { return xerrors.Errorf("opening fs repo: %w", err)