From 1eb626b1dfdcb90cbc6f48c0b67b665ed71fccbe Mon Sep 17 00:00:00 2001 From: Shinnosuke Kondo Date: Mon, 13 Jul 2015 19:08:11 -0500 Subject: [PATCH] Fix keep_files not to match a file with repeated path. --- lib/jekyll/cleaner.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 2a00a737..509cebb1 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -95,11 +95,11 @@ module Jekyll # # Examples # ['.git','.svn'] with site.dest "/myblog/_site" creates - # the following regex: /\/myblog\/_site\/(\.git|\/.svn)/ + # the following regex: /\A\/myblog\/_site\/(\.git|\/.svn)/ # # Returns the regular expression def keep_file_regex - /#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/ + /\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/ end end end