This repository was archived by the owner on Jun 28, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ def compile(self):
122122 filename = os .path .splitext (i )[0 ]
123123 css = '%s.css' % filename
124124 if self ._output :
125- css = css . split ( '/' )[ - 1 ]
125+ css = os . path . relpath ( css , self . _media )
126126 css = '%s/%s' % (self ._output , css )
127127 css_time = - 1 # Poor man's Integer.MIN_VALUE
128128 if os .path .isfile (css ):
@@ -131,13 +131,17 @@ def compile(self):
131131 if less_time >= css_time :
132132 command_opt .append (i )
133133 command_opt .append (css )
134+ css_dir = os .path .dirname (css )
135+ if not os .path .exists (css_dir ):
136+ os .makedirs (css_dir )
134137 subprocess .call (command_opt , shell = False )
135138 if self ._based :
136139 del command_opt [- 1 ]
137140 css_based = '%s-%s.css' % (filename ,
138141 LessCSS .to60 (uuid4 ().time_low ))
139142 if self ._output :
140- css_based = css_based . split ( '/' )[ - 1 ]
143+ css_based = os . path . relpath ( css_based , self . _media )
141144 css_based = '%s/%s' % (self ._output , css_based )
142145 command_opt .append (css_based )
143146 subprocess .call (command_opt , shell = False )
147+ del command_opt [- 2 :]
You can’t perform that action at this time.
0 commit comments