kuzyk / gulp-rigger

Javascript file parser and include engine #buildjs #node http://buildjs.github.io/rigger
41 stars 3 forks source link

Pass filepath to rigger #1

Closed isochronous closed 10 years ago

isochronous commented 10 years ago

Previously, when doing a directory import, rigger did not consider that the importing file would be in the directory being imported, and it would wind up doing one recursion of self-inclusion. This change is part of a small fix that keeps rigger from importing a file into itself - in the _getSingle method, the imported files are checked against the original file path, and if they match exactly, then the imported file is marked as not valid for import.

I've also submitted another pull request to the original Rigger repo to add the fix I mentioned, but the changes in this pull request should be benign even if it takes the rigger author a while to accept the pull request.