Share ignore logic between web and clsi

GitOrigin-RevId: c4ae306413efb71989d2db410c3859cb69b3d5de
This commit is contained in:
andrew rumble 2024-06-12 09:28:34 +01:00 committed by Copybot
parent d627a0bee9
commit 3fa35ef03a
2 changed files with 10 additions and 1 deletions

View file

@ -6,6 +6,10 @@ const { open, realpath } = require('node:fs/promises')
const path = require('path')
const { NotFoundError } = require('./Errors')
// NOTE: Updating this list requires a corresponding change in
// * services/web/frontend/js/features/pdf-preview/util/file-list.js
const ignoreFiles = ['output.fls', 'output.fdb_latexmk']
function getContentDir(projectId, userId) {
let subDir
if (userId != null) {
@ -74,7 +78,10 @@ module.exports = {
)
return outputFiles
.filter(({ path }) => path !== 'output.pdf')
.filter(
// Ignore the pdf and also ignore the files ignored by the frontend.
({ path }) => path !== 'output.pdf' && !ignoreFiles.includes(path)
)
.map(
({ path }) => `${contentDir}${OutputCacheManager.path(build, path)}`
)

View file

@ -1,4 +1,6 @@
const topFileTypes = ['bbl', 'gls', 'ind']
// NOTE: Updating this list requires a corresponding change in
// * services/clsi/app/js/OutputFileArchiveManager.js
const ignoreFiles = ['output.fls', 'output.fdb_latexmk']
export const buildFileList = (