file_search.js 285 B

1234567891011121314
  1. var findup = require('findup-sync');
  2. module.exports = function(search, paths) {
  3. var path;
  4. var len = paths.length;
  5. for (var i = 0; i < len; i++) {
  6. if (path) {
  7. break;
  8. } else {
  9. path = findup(search, { cwd: paths[i], nocase: true });
  10. }
  11. }
  12. return path;
  13. };