avoid running Sass compilation twice

This commit is contained in:
Thomas Reynolds 2014-04-07 09:38:00 -07:00
parent a40ef1a734
commit fcbf9f1568

View file

@ -185,9 +185,7 @@ module Middleman::Cli
@app.sitemap.resources.select do |resource|
resource.ext == '.css'
end.each do |resource|
@rack.get(URI.escape(resource.destination_path))
end
end.each(&method(:build_resource))
logger.debug '== Checking for Compass sprites'
@ -210,8 +208,15 @@ module Middleman::Cli
end
# Loop over all the paths and build them.
resources.each do |resource|
next if @config[:glob] && !File.fnmatch(@config[:glob], resource.destination_path)
resources.reject do |resource|
resource.ext == '.css'
end.each(&method(:build_resource))
::Middleman::Profiling.report('build')
end
def build_resource(resource)
return if @config[:glob] && !File.fnmatch(@config[:glob], resource.destination_path)
output_path = render_to_file(resource)
@ -226,9 +231,6 @@ module Middleman::Cli
end
end
::Middleman::Profiling.report('build')
end
# Render a resource to a file.
#
# @param [Middleman::Sitemap::Resource] resource