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

Automatically recurse on directories #12

Open
mcandre opened this issue Apr 19, 2015 · 1 comment
Open

Automatically recurse on directories #12

mcandre opened this issue Apr 19, 2015 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Apr 19, 2015

As a newbie, I want infernu to automatically recurse on directories, so that I can easily run infernu on large codebases.

As a mitigation, I can:

$ find . -type d -name node_modules -prune -o -type d -name bower_components -prune -o -type d -name target -prune -o -type f -name "*.js" -exec infernu {} \;

But I'd prefer infernu . to "just work", like jshint . just works.

@sinelaw
Copy link
Owner

sinelaw commented Apr 19, 2015

The right way to fix this is to support module systems such as CommonJS/AMD/Closure/Node's require, etc.

For now, a better way to run your script is to pass all the files in the correct dependency order (there are some external tools that resolve dependencies and print the files in order). If you pass the files like you did one by one, infernu will not know about exported/import variables at all (they will be missing).

So for example, you can do:

find . -type f -iname "*.js" | xargs infernu

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