Skip to content

Commit

Permalink
Fix encoding discrepancy in excluded Windows paths (#76)
Browse files Browse the repository at this point in the history
Merge pull request 76
  • Loading branch information
ashmaroli authored and jekyllbot committed Nov 10, 2018
1 parent 05dea60 commit 0cfb214
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/jekyll/watcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ def listen_handler(site)
end
end

def normalize_encoding(obj, desired_encoding)
case obj
when Array
obj.map { |entry| entry.encode!(desired_encoding, entry.encoding) }
when String
obj.encode!(desired_encoding, obj.encoding)
end
end

def custom_excludes(options)
Array(options["exclude"]).map { |e| Jekyll.sanitized_path(options["source"], e) }
end
Expand Down Expand Up @@ -93,7 +102,7 @@ def listen_ignore_paths(options)
paths = to_exclude(options)

paths.map do |p|
absolute_path = Pathname.new(p).expand_path
absolute_path = Pathname.new(normalize_encoding(p, options["source"].encoding)).expand_path
next unless absolute_path.exist?

begin
Expand Down

0 comments on commit 0cfb214

Please sign in to comment.