mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
Merge pull request #8714 from overleaf/em-promisify-compile-manager
Promisify CompileManager GitOrigin-RevId: 644ed061ae139d6196b24f8ead38579de6b844a3
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Path = require('path')
|
||||
const { promisify } = require('util')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const logger = require('@overleaf/logger')
|
||||
const CommandRunner = require('./CommandRunner')
|
||||
@@ -192,4 +193,17 @@ function _buildLatexCommand(mainFile, opts = {}) {
|
||||
module.exports = {
|
||||
runLatex,
|
||||
killLatex,
|
||||
promises: {
|
||||
runLatex: (projectId, options) =>
|
||||
new Promise((resolve, reject) => {
|
||||
runLatex(projectId, options, (err, output, stats, timing) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve({ output, stats, timing })
|
||||
}
|
||||
})
|
||||
}),
|
||||
killLatex: promisify(killLatex),
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user