Skip to content

Commit 6829356

Browse files
committed
fix: use filepath when handling OS paths
fixes ipfs/go-ipfs-files#16
1 parent 96503ab commit 6829356

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

add.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"context"
55
"encoding/json"
66
"errors"
7+
"filepath"
78
"io"
89
"os"
9-
"path"
1010

1111
"github.com/ipfs/go-ipfs-files"
1212
)
@@ -90,7 +90,7 @@ func (s *Shell) AddDir(dir string) (string, error) {
9090
if err != nil {
9191
return "", err
9292
}
93-
slf := files.NewSliceDirectory([]files.DirEntry{files.FileEntry(path.Base(dir), sf)})
93+
slf := files.NewSliceDirectory([]files.DirEntry{files.FileEntry(filepath.Base(dir), sf)})
9494
reader := files.NewMultiFileReader(slf, true)
9595

9696
resp, err := s.Request("add").

0 commit comments

Comments
 (0)