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

glob like functionality would be handy #122

Closed
tansaku opened this issue Dec 27, 2018 · 9 comments
Closed

glob like functionality would be handy #122

tansaku opened this issue Dec 27, 2018 · 9 comments

Comments

@tansaku
Copy link
Contributor

tansaku commented Dec 27, 2018

on a local file system one can use a library like glob to get all the files matching a particular pattern

https://github.com/isaacs/node-glob#readme

being able to do over webdav would be handy, although clearly some patterns could be very time consuming to match ...

@perry-mitchell
Copy link
Owner

I like this idea.. I also think it'd be very useful.

Are you thinking that such functionality would be just used to return a list of files?

For instance: client.glob("/dir/**/*.mp4") :

/dir/test.mp4
/dir/sub/dir/video.mp4
/dir/dir/movie.mp4

@tansaku
Copy link
Contributor Author

tansaku commented Dec 30, 2018

@perry-mitchell yes, exactly

@perry-mitchell
Copy link
Owner

@tansaku Any opinion on the function name? I was thinking along the following lines, but don't have a hard opinion on the subject as of yet:

  • glob
  • getPaths
  • getFilenames

@tansaku
Copy link
Contributor Author

tansaku commented Dec 30, 2018

@perry-mitchell I guess I'd go for glob, although it's not wonderfully self-explanatory https://en.wikipedia.org/wiki/Glob_(programming)

one can always have additional alternative function names that map to the same thing.

@perry-mitchell
Copy link
Owner

Yeah in that way I'd personally opt for getPaths or something more descriptive.

@tansaku
Copy link
Contributor Author

tansaku commented Dec 31, 2018

something like allMatchingPaths might be good ... something that indicates we are looking for matches ... maybe even allPathsMatchingPattern

there are various linters that push we away from using the get prefix, but getPathsMatchingPattern would fit in with the existing function names I guess ... although excessive perhaps if there is no alternate "non-matching" getPaths function ...

@perry-mitchell
Copy link
Owner

I hear you.. Is getMatchingPaths too brief? I do like the get prefix as it indicates that an action will take place. all... sounds too passive for my taste as it just sounds like a getter.

At least we agree that this function would be super helpful, regardless of what the name may be.

@tansaku
Copy link
Contributor Author

tansaku commented Jan 2, 2019

getMatchingPaths just fine :-)

@perry-mitchell
Copy link
Owner

Released in 2.6.0.

I converted { glob: { pattern: "..." } } to { glob: "..." } for simplicity. Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants