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
|
rootResourcePathOverride = path
|
||||||
|
|
||||||
rootResourcePath = rootResourcePathOverride if rootResourcePathOverride?
|
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
|
for path, file of files
|
||||||
path = path.replace(/^\//, "") # Remove leading /
|
path = path.replace(/^\//, "") # Remove leading /
|
||||||
|
@ -94,9 +97,6 @@ module.exports = ClsiManager =
|
||||||
url: "#{Settings.apis.filestore.url}/project/#{project._id}/file/#{file._id}"
|
url: "#{Settings.apis.filestore.url}/project/#{project._id}/file/#{file._id}"
|
||||||
modified: file.created?.getTime()
|
modified: file.created?.getTime()
|
||||||
|
|
||||||
if !rootResourcePath?
|
|
||||||
callback new Error("no root document exists")
|
|
||||||
else
|
|
||||||
callback null, {
|
callback null, {
|
||||||
compile:
|
compile:
|
||||||
options:
|
options:
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe "ClsiManager", ->
|
||||||
url: "https://clsipremium.example.com"
|
url: "https://clsipremium.example.com"
|
||||||
"../../models/Project": Project: @Project = {}
|
"../../models/Project": Project: @Project = {}
|
||||||
"../Project/ProjectEntityHandler": @ProjectEntityHandler = {}
|
"../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 = {}
|
"request": @request = {}
|
||||||
@project_id = "project-id"
|
@project_id = "project-id"
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
|
@ -219,8 +219,8 @@ describe "ClsiManager", ->
|
||||||
@ClsiManager._buildRequest @project, null, (@error, @request) =>
|
@ClsiManager._buildRequest @project, null, (@error, @request) =>
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it "should return an error", ->
|
it "should set to main.tex", ->
|
||||||
expect(@error).to.exist
|
@request.compile.rootResourcePath.should.equal "main.tex"
|
||||||
|
|
||||||
describe "with the draft option", ->
|
describe "with the draft option", ->
|
||||||
it "should add the draft option into the request", (done) ->
|
it "should add the draft option into the request", (done) ->
|
||||||
|
|
Loading…
Reference in a new issue