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.
This commit is contained in:
Parker Moore 2013-03-16 13:57:28 +01:00
parent b49bba9351
commit 1d920f52f1
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ module Jekyll
def self.globs(source, destination) def self.globs(source, destination)
Dir.chdir(source) do Dir.chdir(source) do
dirs = Dir['*'].select { |x| File.directory?(x) } dirs = Dir['*'].select { |x| File.directory?(x) }
dirs -= [destination] dirs -= [destination, File.realpath(destination), File.basename(destination)]
dirs = dirs.map { |x| "#{x}/**/*" } dirs = dirs.map { |x| "#{x}/**/*" }
dirs += ['*'] dirs += ['*']
end end