mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Don't treat no root resource as a fatal error
This commit is contained in:
parent
8fb3e629e8
commit
6beb29f449
2 changed files with 17 additions and 17 deletions
|
@ -86,6 +86,9 @@ module.exports = ClsiManager =
|
|||
rootResourcePathOverride = path
|
||||
|
||||
rootResourcePath = rootResourcePathOverride if rootResourcePathOverride?
|
||||
if !rootResourcePath?
|
||||
logger.warn {project_id}, "no root document found, setting to main.tex"
|
||||
rootResourcePath = "main.tex"
|
||||
|
||||
for path, file of files
|
||||
path = path.replace(/^\//, "") # Remove leading /
|
||||
|
@ -94,9 +97,6 @@ module.exports = ClsiManager =
|
|||
url: "#{Settings.apis.filestore.url}/project/#{project._id}/file/#{file._id}"
|
||||
modified: file.created?.getTime()
|
||||
|
||||
if !rootResourcePath?
|
||||
callback new Error("no root document exists")
|
||||
else
|
||||
callback null, {
|
||||
compile:
|
||||
options:
|
||||
|
|
|
@ -19,7 +19,7 @@ describe "ClsiManager", ->
|
|||
url: "https://clsipremium.example.com"
|
||||
"../../models/Project": Project: @Project = {}
|
||||
"../Project/ProjectEntityHandler": @ProjectEntityHandler = {}
|
||||
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
|
||||
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub(), warn: sinon.stub() }
|
||||
"request": @request = {}
|
||||
@project_id = "project-id"
|
||||
@callback = sinon.stub()
|
||||
|
@ -219,8 +219,8 @@ describe "ClsiManager", ->
|
|||
@ClsiManager._buildRequest @project, null, (@error, @request) =>
|
||||
done()
|
||||
|
||||
it "should return an error", ->
|
||||
expect(@error).to.exist
|
||||
it "should set to main.tex", ->
|
||||
@request.compile.rootResourcePath.should.equal "main.tex"
|
||||
|
||||
describe "with the draft option", ->
|
||||
it "should add the draft option into the request", (done) ->
|
||||
|
|
Loading…
Reference in a new issue