infernu icon indicating copy to clipboard operation
infernu copied to clipboard

Automatically recurse on directories

Open mcandre opened this issue 9 years ago • 1 comments

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.

mcandre avatar Apr 19 '15 17:04 mcandre

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

sinelaw avatar Apr 19 '15 19:04 sinelaw