NebulousLabs / go-skynet

An SDK for integrating Skynet into Golang applications
MIT License
16 stars 8 forks source link

[WIP] Fix behavior of walkdirectory #4

Closed mrcnski closed 4 years ago

mrcnski commented 4 years ago

Uploading directories is broken. We join the initial path with subpaths given by WalkDir, which is not correct. Here are a few iterations of walking a directory dir with a file called file:

path: ./dir, subpath: ./dir
fullpath: dir/dir
path: dir/file, subpath: dir/file
fullpath: dir/file/dir/file
path: ./dir, subpath: dir/file
fullpath: dir/dir/file

The resulting list of files:

files: [dir/file/dir/file dir/dir/file]

We should be

  1. Not joining the subpath to the initial path
  2. Ignoring subpaths if they are equal to the initial path