From 1d920f52f1db09b3f654f88fab8b7fcfd0941d03 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 16 Mar 2013 13:57:28 +0100 Subject: [PATCH] Fix bug where Command.globs didn't delete the destination directory. There was often a mix between absolute and relative paths and in the previous version, the destination argument was usually an absolute path where the glob array (from Dir['*']) was a relative path. --- lib/jekyll/command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb index bbc9e8a6..ab553dd8 100644 --- a/lib/jekyll/command.rb +++ b/lib/jekyll/command.rb @@ -3,7 +3,7 @@ module Jekyll def self.globs(source, destination) Dir.chdir(source) do dirs = Dir['*'].select { |x| File.directory?(x) } - dirs -= [destination] + dirs -= [destination, File.realpath(destination), File.basename(destination)] dirs = dirs.map { |x| "#{x}/**/*" } dirs += ['*'] end