Merge pull request #4809 from djdv/fix/get/outpath

Fix get output path
This commit is contained in:
Whyrusleeping 2018-03-22 23:29:17 -07:00 committed by GitHub
commit aaf6ee78cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ import (
"fmt"
"io"
"os"
gopath "path"
"path/filepath"
"strings"
core "github.com/ipfs/go-ipfs/core"
@ -183,8 +183,8 @@ func getOutPath(req *cmds.Request) string {
outPath, _ := req.Options["output"].(string)
if outPath == "" {
trimmed := strings.TrimRight(req.Arguments[0], "/")
_, outPath = gopath.Split(trimmed)
outPath = gopath.Clean(outPath)
_, outPath = filepath.Split(trimmed)
outPath = filepath.Clean(outPath)
}
return outPath
}