| 141 | assert 0 # unhandled action type |
| 142 | |
| 143 | def subdir_files(options, path, dest, action): |
| 144 | source_path, _ = mkpaths(options, path, dest) |
| 145 | ret = {} |
| 146 | for dirpath, dirnames, filenames in os.walk(source_path): |
| 147 | files_in_path = [os.path.join(os.path.relpath(dirpath, options.root_dir), f) for f in filenames if f.endswith('.h')] |
| 148 | ret[os.path.join(dest, os.path.relpath(dirpath, source_path))] = files_in_path |
| 149 | for subdir, files_in_path in ret.items(): |
| 150 | action(options, files_in_path, subdir + os.path.sep) |
| 151 | |
| 152 | def files(options, action): |
| 153 | node_bin = 'node' |