cyberdelia/django-pipeline — pull request #323 by spectras (2014-03-07 12:39:10+00:00)
Title: PipelineStorage.listdir short-circuit returning the first match only

I have been using pipeline for awhile and like the way it integrates with my workflow. However, I encountered an issue while trying to use * for globbing on a directory that exists in every app folder, like this:
```python
PIPELINE_JS = {
'templates': {
'source_filenames': (
'js/templates/*/*.dust', # I made a custom compiler for that
),
'output_filename': 'js/templates.min.js',
},
}```
This way, {{ compressed_js 'templates }} only includes the files of the first directory that matches. Sample directory tree:
* myappA/static/js/templates/myappA/mytemplate1.dust
* myappA/static/js/templates/myappA/mytemplate2.dust
* myappB/static/js/templates/myappB/mytemplate3.dust
* myappB/static/js/templates/myappB/mytemplate4.dust

I narrowed down the issue to glob1's call to listdir on the default storage (that proxies to a PipelineFinderStorage instance). What seems to happen is glob1 expects listdir to return all files in 'js/templates', but listdir only lists stuff in __the first__ storage that has a 'js/templates'.

Attached pull request fixes the issue for me. Unfortunately I am not familiar enough with the codebase to do proper testing.