parse abs path for import file

This commit is contained in:
wanghui 2019-10-23 15:05:22 +08:00
parent c6165ac654
commit d6ca19586b

View File

@ -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
}