Open ilovett opened 11 years ago
Is this not supported by using a double star wildcard?
Pipeline use a very similar to python glob implementation, so double star should work.
I will retest when I get a chance in a week or 2.
On Apr 28, 2013, at 7:13 PM, Timothée Peignier notifications@github.com wrote:
Pipeline use a very similar to python glob implementation, so double star should work.
— Reply to this email directly or view it on GitHub.
Got a chance to re-test. Double star **/*.js
will include folder/file.js
but will not recursively include folder/folder/file.js
In order to get folder/folder/file.js
, I need to set up **/**/*.js
Is double star intended to include recursively? Or just 1 directory deep wildcard inclusion?
@ilovett are you on OSX by an chance?
@rickeyvisinski-kanban running on ubuntu...
Looks like I have misunderstood use of **
by fluke it was just acting as a single *
.
Update: It is my understanding now that **
should universally mean "recursive subfolders". It looks like the glob documentation which @cyberdelia mentioned only supports single *
. I see some discussion opened in adding it to python glob here.
We would essentially need to setup **
to mean recursive folder and implement this way
Its not a fluke, its the way python's globbing currently works, eg they haven't implemented the globstar match.
Even if they had, pipeline uses default storage for static assets, we have no access to os.walk, basically only exists and listdir.
I took a stab at implementing the globstar on my branch https://github.com/rickeyvisinski-kanban/django-pipeline/tree/globstar; however, now that path/*/.js works, it broke the original globbing so I have some more work to do.
I have been searching for this for a while and am just wondering if there are plans for this recursive function to be implemented any time soon. Instead of having to list all potential subdirectories it would be nice to just list a directory and include all of its subdirectories.
I've been using thing like views/**/*.coffee
for a while :expressionless:
Hmm so what am I missing? My directory structure is
And my PIPELINE_JS is
PIPELINE_JS = {
'views': {
'source_filenames': (
'coffee/views/**/*.coffee',
),
'output_filename': 'js/views/views.js,
}
}
However only first.coffee and second.coffee get compiled to js and appear on my page. However subone.coffee is never seen. What would I be missing since the first level of directories are reached, but not the second level?
EDIT
Forgot about this. If it ends up mattering I'm using django 1.6.6 and Python 3.4.1. Let me know if that would be the issue.
@cdimoulis **
doesn't work recursively, you have use if for each depth IE:
'coffee/views/**/*.coffee',
'coffee/views/**/**/*.coffee',
Oh god :confused:
For other finding this through google: https://pypi.python.org/pypi/glob2
Make does not offer a recursive wildcard function, so here's one:
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
How to recursively find all files with the same name in a given folder
ALL_MAKEFILES := $(call rwildcard,src/,Makefile.mk)
How to recursively find all files that match a pattern
SUBDIRS = $(call rwildcard,src/,.mk)
This would essentially allow for recursive inclusion of files in all subfolders.
For example, currently would have to include files
This would be simplified with: