fix issue with UTF-8-MAC paths not matching UTF-8 paths in build clean
This commit is contained in:
parent
f9728108cc
commit
a1090f912c
|
@ -159,6 +159,7 @@ module Middleman::Cli
|
||||||
return unless File.exist?(@build_dir)
|
return unless File.exist?(@build_dir)
|
||||||
|
|
||||||
paths = ::Middleman::Util.all_files_under(@build_dir).map(&:realpath).select(&:file?)
|
paths = ::Middleman::Util.all_files_under(@build_dir).map(&:realpath).select(&:file?)
|
||||||
|
|
||||||
@to_clean += paths.select do |path|
|
@to_clean += paths.select do |path|
|
||||||
path.to_s !~ /\/\./ || path.to_s =~ /\.(htaccess|htpasswd)/
|
path.to_s !~ /\/\./ || path.to_s =~ /\.(htaccess|htpasswd)/
|
||||||
end
|
end
|
||||||
|
@ -211,9 +212,15 @@ module Middleman::Cli
|
||||||
output_path = render_to_file(resource)
|
output_path = render_to_file(resource)
|
||||||
|
|
||||||
if should_clean? && output_path.exist?
|
if should_clean? && output_path.exist?
|
||||||
|
if RUBY_PLATFORM =~ /darwin/
|
||||||
|
# handle UTF-8-MAC filename on MacOS
|
||||||
|
|
||||||
|
@to_clean.delete(output_path.realpath.to_s.encode('UTF-8', 'UTF-8-MAC'))
|
||||||
|
else
|
||||||
@to_clean.delete(output_path.realpath)
|
@to_clean.delete(output_path.realpath)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
::Middleman::Profiling.report("build")
|
::Middleman::Profiling.report("build")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue