Skip to content

Commit 11d7ee7

Browse files
committed
Naming things is hard.
1 parent dbd6dd6 commit 11d7ee7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pydotorg/pipeline.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import subprocess
23

34
from .settings import BASE
45

@@ -63,3 +64,13 @@
6364

6465
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
6566
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
67+
68+
# Homebrew installs yuicompressor as "yuicompressor", but Apt installs it as
69+
# "yui-compressor". FLAIL.
70+
for yuicompressor in ['yuicompressor', 'yui-compressor']:
71+
if subprocess.call(['which', yuicompressor], stdout=subprocess.PIPE) == 0:
72+
PIPELINE_YUI_BINARY = yuicompressor
73+
break
74+
else:
75+
import warnings
76+
warnings.warn("No yuicompressor found; this means collectstatic won't work.")

pydotorg/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,6 @@
128128
PIPELINE_CSS, PIPELINE_JS,
129129
PIPELINE_COMPILERS,
130130
PIPELINE_SASS_BINARY, PIPELINE_SASS_ARGUMENTS,
131-
PIPELINE_CSS_COMPRESSOR, PIPELINE_JS_COMPRESSOR
131+
PIPELINE_CSS_COMPRESSOR, PIPELINE_JS_COMPRESSOR,
132+
PIPELINE_YUI_BINARY,
132133
)

0 commit comments

Comments
 (0)