Skip to content

Commit

Permalink
Fix get output path
Browse files Browse the repository at this point in the history
Minor but important change for platform native output paths

License: MIT
Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
  • Loading branch information
djdv committed Mar 12, 2018
1 parent 5622cc5 commit dcd7e6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/commands/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"io"
"os"
gopath "path"
"path/filepath"
"strings"

core "github.com/ipfs/go-ipfs/core"
Expand Down Expand Up @@ -187,8 +187,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
}
Expand Down

0 comments on commit dcd7e6c

Please sign in to comment.