Merge pull request #96 from sharelatex/bg-cache-eps-to-pdf-converted-files

cache pdf files generated by epstopdf
This commit is contained in:
Brian Gough 2018-09-11 13:31:26 +01:00 committed by GitHub
commit 9870683ae8
2 changed files with 10 additions and 0 deletions

View file

@ -80,6 +80,8 @@ module.exports = ResourceWriter =
should_delete = false should_delete = false
if path.match(/^output-.*/) # Tikz cached figures if path.match(/^output-.*/) # Tikz cached figures
should_delete = false should_delete = false
if path.match(/-eps-converted-to\.pdf$/) # Epstopdf generated files
should_delete = false
if path == "output.pdf" or path == "output.dvi" or path == "output.log" or path == "output.xdv" if path == "output.pdf" or path == "output.dvi" or path == "output.log" or path == "output.xdv"
should_delete = true should_delete = true
if path == "output.tex" # created by TikzManager if present in output files if path == "output.tex" # created by TikzManager if present in output files

View file

@ -134,6 +134,9 @@ describe "ResourceWriter", ->
type: "aux" type: "aux"
}, { }, {
path: "cache/_chunk1" path: "cache/_chunk1"
},{
path: "figures/image-eps-converted-to.pdf"
type: "pdf"
}] }]
@resources = "mock-resources" @resources = "mock-resources"
@OutputFileFinder.findOutputFiles = sinon.stub().callsArgWith(2, null, @output_files) @OutputFileFinder.findOutputFiles = sinon.stub().callsArgWith(2, null, @output_files)
@ -165,6 +168,11 @@ describe "ResourceWriter", ->
.calledWith(path.join(@basePath, "cache/_chunk1")) .calledWith(path.join(@basePath, "cache/_chunk1"))
.should.equal false .should.equal false
it "should not delete the epstopdf converted files", ->
@ResourceWriter._deleteFileIfNotDirectory
.calledWith(path.join(@basePath, "figures/image-eps-converted-to.pdf"))
.should.equal false
it "should call the callback", -> it "should call the callback", ->
@callback.called.should.equal true @callback.called.should.equal true