Skip to content

Commit

Permalink
Merge pull request ipfs#3023 from ipfs/feature/eval-symlink-windows
Browse files Browse the repository at this point in the history
cli: do ToSlash after EvalSymlinks to remove platform specific slashes
  • Loading branch information
whyrusleeping authored Aug 3, 2016
2 parents 8c77ff8 + 40741ea commit 16c5a89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion commands/cli/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,14 @@ func appendFile(fpath string, argDef *cmds.Argument, recursive, hidden bool) (fi
fpath = cwd
}

fpath = filepath.ToSlash(filepath.Clean(fpath))
fpath = filepath.Clean(fpath)
fpath, err := filepath.EvalSymlinks(fpath)
if err != nil {
return nil, err
}
// Repeat ToSlash after EvalSymlinks as it turns path to platform specific
fpath = filepath.ToSlash(fpath)

stat, err := os.Lstat(fpath)
if err != nil {
return nil, err
Expand Down

0 comments on commit 16c5a89

Please sign in to comment.