Merge pull request #1117 from bhollis/utf8mac
Fix a perf regression when building
This commit is contained in:
commit
fe2f43e8a4
|
@ -162,6 +162,11 @@ module Middleman::Cli
|
|||
@to_clean += paths.select do |path|
|
||||
path.to_s !~ /\/\./ || path.to_s =~ /\.(htaccess|htpasswd)/
|
||||
end
|
||||
|
||||
if RUBY_PLATFORM =~ /darwin/
|
||||
# handle UTF-8-MAC filename on MacOS
|
||||
@to_clean.map { |path| path.to_s.encode('UTF-8', 'UTF-8-MAC') }
|
||||
end
|
||||
end
|
||||
|
||||
# Actually build the app
|
||||
|
@ -206,12 +211,7 @@ module Middleman::Cli
|
|||
output_path = render_to_file(resource)
|
||||
|
||||
if should_clean? && output_path.exist?
|
||||
if RUBY_PLATFORM =~ /darwin/
|
||||
# handle UTF-8-MAC filename on MacOS
|
||||
@to_clean.delete_if { |path| path.to_s.encode('UTF-8', 'UTF-8-MAC') == output_path.realpath.to_s }
|
||||
else
|
||||
@to_clean.delete(output_path.realpath)
|
||||
end
|
||||
@to_clean.delete(output_path.realpath)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue