-
Notifications
You must be signed in to change notification settings - Fork 7
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
FYI — directories / clio_extended
#10
Comments
This is a neat idea. I have released version 0.3 which adds a struct for tracking a path (which may be stdin/stdout) and was the perfect place to add a files method to list files in a directory. So you should now be able to do something like:
(well ignoring the relative path name tidying up you do) Does that work? I contemplated making it return a |
I'm CCing @aljazerzen who wrote most of the code on our end if he has any thoughts.
|
Yup, ClioPath does it: PRQL/prql#2847 |
Wonderful! I'll close... |
Glad it was useful, of you have any other changes you want to make pull request are always welcome. I didn't implement Passing it to walkdir would have similar issues, whereas the files method returns a Vec containing the original ClioPath if it is not a directory. To be honest I should probably remove the Deref impl and pick some proper semantics for all Path methods and reimplemented properly. Is stdin a file? Does it have metadata? Does it exist? What about URLs? |
Ah, that makes a lot of sense. Thanks for the explanation... |
Just an FYI that over at PRQL we wanted our CLI to also be able take a directory, and so added some logic to
clio
in our crate.We're very open to feedback on whether we're doing reasonable things!
Here's the code: https://github.com/prql/prql/blob/c1150818f4497c89164ba9ec9468459acb8a191c/prql-compiler/prqlc/src/cli.rs#L409
Feel free to close as soon as you've seen this. Thanks.
The text was updated successfully, but these errors were encountered: