Skip to content

Commit

Permalink
make dirs if they don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Rudolph committed Jan 12, 2016
1 parent 2036473 commit 3025c07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions corehq/apps/style/uglify.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import subprocess

from compressor.exceptions import FilterError
Expand Down Expand Up @@ -69,6 +70,11 @@ def output(self, mode='file', forced=False):
c.encode(self.charset) for c in content)

if settings.COMPRESS_ENABLED or forced:
js_compress_dir = os.path.join(
settings.STATIC_ROOT, self.output_dir, self.output_prefix
)
if not os.path.exists(js_compress_dir):
os.makedirs(js_compress_dir, 0775)
filepath = self.get_filepath(concatenated_content, basename=None)

# UglifySourcemapFilter writes the file directly, as it needs to
Expand Down

0 comments on commit 3025c07

Please sign in to comment.