Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs.walk #192

Merged
merged 2 commits into from
Feb 15, 2019
Merged

fs.walk #192

merged 2 commits into from
Feb 15, 2019

Conversation

hayd
Copy link
Contributor

@hayd hayd commented Feb 13, 2019

#189

  • tests passing (this is passing locally on osx for me)... I think failure is due to not sorting.
  • add docstrings
  • support symlinks (Perhaps add later?)
  • add docs/to README.
  • add async version (make this walk and walkSync)

fs/walk.ts Outdated
}


export function *walk(dir: string, options: WalkOptions = {}): IterableIterator<FileInfo> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsdoc with example please

fs/walk_test.ts Outdated
await mkdir(d + "/dir_empty");
},
function emptyDir() {
const arr = Array.from(walk("."), (f: FileInfo) => f.path);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful!

remove(d, {recursive: true});
}
}
test({ name, fn });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this pattern of wrapping the test function for setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bert suggested this in discussion of setup/teardown for testFileserver - I should push a branch with that change too...

@hayd
Copy link
Contributor Author

hayd commented Feb 13, 2019

Is symlink not supported in windows?

@hayd
Copy link
Contributor Author

hayd commented Feb 14, 2019

@ry does this suffice for jsdoc?
(There's a lack of docs in all of std!)

This supports lots of options now, and has both async and sync versions.

@hayd hayd changed the title WIP fs.walk fs.walk Feb 14, 2019
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hayd Yes, thanks. LGTM

@ry ry merged commit 3be908f into denoland:master Feb 15, 2019
@hayd hayd mentioned this pull request Feb 16, 2019
@hayd hayd deleted the walk branch May 24, 2019 19:51
ry pushed a commit to ry/deno that referenced this pull request Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants