Fix #4075: Make sure that .jekyll-metadata is not generated when not needed.
This commit is contained in:
parent
dfae4669e4
commit
71f4383d18
|
@ -130,8 +130,10 @@ module Jekyll
|
|||
#
|
||||
# Returns nothing.
|
||||
def write_metadata
|
||||
unless disabled?
|
||||
File.binwrite(metadata_file, Marshal.dump(metadata))
|
||||
end
|
||||
end
|
||||
|
||||
# Produce the absolute path of the metadata file
|
||||
#
|
||||
|
|
|
@ -305,4 +305,23 @@ class TestRegenerator < JekyllUnitTest
|
|||
assert @regenerator.modified?(@path)
|
||||
end
|
||||
end
|
||||
|
||||
context "when incremental regen is disabled" do
|
||||
setup do
|
||||
FileUtils.rm_rf(source_dir(".jekyll-metadata"))
|
||||
@site = Site.new(Jekyll.configuration({
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"incremental" => false
|
||||
}))
|
||||
|
||||
@site.process
|
||||
@path = @site.in_source_dir(@site.pages.first.path)
|
||||
@regenerator = @site.regenerator
|
||||
end
|
||||
|
||||
should "not create .jekyll-metadata" do
|
||||
refute File.file?(source_dir(".jekyll-metadata"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue