From d6ca19586bc070448c686384ad5e3c1b332d999e Mon Sep 17 00:00:00 2001 From: wanghui Date: Wed, 23 Oct 2019 15:05:22 +0800 Subject: [PATCH] parse abs path for import file --- cli/client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/client.go b/cli/client.go index d2a163a01..e9e5814c7 100644 --- a/cli/client.go +++ b/cli/client.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "path/filepath" "strconv" "github.com/ipfs/go-cid" @@ -37,8 +38,12 @@ var clientImportCmd = &cli.Command{ } defer closer() ctx := ReqContext(cctx) + absPath, err := filepath.Abs(cctx.Args().First()) + if err != nil { + return err + } - c, err := api.ClientImport(ctx, cctx.Args().First()) + c, err := api.ClientImport(ctx, absPath) if err != nil { return err }