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

Add ReadDir function to list local files #1204

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@rustyoz
Contributor

rustyoz commented Jun 12, 2015

Adds functionality wanted by @Lynxiayel in this community post

@spf13

This comment has been minimized.

Contributor

spf13 commented Jun 12, 2015

Can you add a test for this?

@rustyoz

This comment has been minimized.

Contributor

rustyoz commented Jun 12, 2015

I honestly don't know how I would do that progammatically.
The addition to the docs includes a shortcode that is used in the documentation that uses the command. The command is passed a string with a forward slash included and this works fine on Windows.

At the moment all I can do is say that it has worked for me on both windows and linux with forward and backward slashes used in the path.

@bep

This comment has been minimized.

Member

bep commented Jun 12, 2015

@rustyoz: This looks fine, but as it is now it is possible to navigate outside the WorkDir. This may sound innocent, and it mostly is, but one could imagine a theme author doing something stupid.

So some thightening of that issue would be nice.

@rustyoz

This comment has been minimized.

Contributor

rustyoz commented Jun 13, 2015

I have updated the commit to include a test for parent directory markers ".." which should prevent navigation outside of the working directory

@bep

This comment has been minimized.

Member

bep commented Jun 26, 2015

@rustyoz I haven't forgotten this. I want this feature. Just want some other to chime on to evaluate if the ".." check is protection good enough.

@spf13

others?

@rustyoz

This comment has been minimized.

Contributor

rustyoz commented Jun 27, 2015

All good. It seems like the appveyor test failure was due to a missing newline of all things.

Add ReadDir function to list local files.
Includes documentation.
@bep

This comment has been minimized.

Member

bep commented Jul 25, 2015

Merged in 81e69c4

This is very useful. And thanks for taking the time to write some solid documentation. It's boring, but needed.

@bep bep closed this Jul 25, 2015

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