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

Path ** does not recurse directories #48

Closed
ghost opened this issue Jul 25, 2016 · 6 comments
Closed

Path ** does not recurse directories #48

ghost opened this issue Jul 25, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Jul 25, 2016

I would expect leasot src/**/*.js to recurse directories within src and parse all js files

Example directory structure:

src
+-- todo-root.js
+-- folderA
       +-- todo-A-1.js
       +-- todo-A-2.js
+-- folderB
       +-- todo-B-1.js
       +-- todo-B-2.js
       +-- folderC
              +-- todo-C-1.js
              +-- todo-C-2.js

Correct Cases
Running leasot src/*.js parses files in src only, i.e. todo-root.js
Running leasot src/*/*/*.js parses files in folderC only

Incorrect Cases
Running leasot src/**/*.js parses files in folderA and the root of folderB only (It is missing todo-root.js as well as the files in folderC

@pgilad
Copy link
Owner

pgilad commented Aug 24, 2016

I agree with that what you suggested is the correct behavior for **/*.js parsing.

It also might be a problem with your shell, since leasot uses glob (https://github.com/pgilad/leasot/blob/master/lib/cli.js#L55) which should support this use case.

Can you try it with the following syntax:
leasot 'src/**/*.js' ? This will prevent your shell from expanding that glob.

@pgilad
Copy link
Owner

pgilad commented Aug 25, 2016

Let me know if I can help further

@pgilad pgilad closed this as completed Aug 25, 2016
@ghost
Copy link
Author

ghost commented Aug 27, 2016

The issue still remains:

leasot src/**/*.js
leasot "src/**/*.js"
leasot 'src/**/*.js'

All of the above still do not recurse through sub-directories

@pgilad pgilad reopened this Aug 27, 2016
@pgilad
Copy link
Owner

pgilad commented Aug 27, 2016

I've just tried to reproduce your error using the exact same file structure you mentioned (just called the root folder temp).
After running leasot this is what I get:
image

Also, if I run it with quotes around the glob pattern:
image

So I pretty much think this is an error with your OS or shell. Which do you use?

@ghost
Copy link
Author

ghost commented Aug 30, 2016

I can confirm it does infact work properly but quotes " ' are needed. Sorry for the false alarm!

@ghost ghost closed this as completed Aug 30, 2016
@dkebler
Copy link
Contributor

dkebler commented Oct 9, 2016

yup I missed this too but this gets me back to my recent issue #50 about excluding directories because if I try to do this from the root of my project it also searches node_modules until it crashes.
so yes on exclude directories, and maybe have a switch to exclude a .gitignore file would be cool

@dkebler dkebler mentioned this issue Oct 9, 2016
This issue was closed.
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