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:
parent
b49bba9351
commit
1d920f52f1
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue