(dir, store, re)
| 11 | find - a (very) basic implementation of the unix command line tool. |
| 12 | */ |
| 13 | function find(dir, store, re) { |
| 14 | var files = dir.listFiles(); |
| 15 | foreach(files, function(filename) { |
| 16 | filename = '' + filename; |
| 17 | var file = new File(filename); |
| 18 | if (file.isDirectory()) { |
| 19 | find(file, store, re); |
| 20 | } else { |
| 21 | if (typeof re == 'undefined') store.push(filename); |
| 22 | else if (filename.match(re)) store.push(filename); |
| 23 | } |
| 24 | }); |
| 25 | } |
| 26 | /* |
| 27 | the main module file for a given directory |
| 28 | (assuming the main module is in a file with the same name as the parent |
no test coverage detected