Ensure that js files are returned in alphabetical order by django-pipeline.

On most systems this seems to be the default behavior, but glob2.glob's order isn't guaranteed and on my machine the order seems to be random, which causes javascript which depends on include order to fail.
This commit is contained in:
Ibrahim Awwal
2012-08-28 22:38:56 -07:00
parent d1238a277f
commit f6ee08271d

View File

@@ -426,7 +426,7 @@ main_vendor_js = [
'js/vendor/jquery.qtip.min.js',
]
discussion_js = glob2.glob(PROJECT_ROOT / 'static/coffee/src/discussion/*.coffee')
discussion_js = sorted(glob2.glob(PROJECT_ROOT / 'static/coffee/src/discussion/*.coffee'))
# Load javascript from all of the available xmodules, and
# prep it for use in pipeline js
@@ -494,10 +494,10 @@ PIPELINE_JS = {
'source_filenames': [
pth.replace(COMMON_ROOT / 'static/', '')
for pth
in glob2.glob(COMMON_ROOT / 'static/coffee/src/**/*.coffee')
in sorted(glob2.glob(COMMON_ROOT / 'static/coffee/src/**/*.coffee'))
] + [
pth.replace(PROJECT_ROOT / 'static/', '')
for pth in glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee')\
for pth in sorted(glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee'))\
if pth not in courseware_only_js and pth not in discussion_js
] + [
'js/form.ext.js',