mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 22:47:25 +01:00
22 lines
524 B
TypeScript
22 lines
524 B
TypeScript
import { ExecOptions } from 'node:child_process'
|
|
import path from 'path'
|
|
|
|
export function getDirPath(id: string) {
|
|
return `/tmp/pdfer-${id}`
|
|
}
|
|
|
|
export function getDocPath(id: string) {
|
|
return path.join(getDirPath(id), 'doc.tex')
|
|
}
|
|
|
|
export function getPdfPath(id: string) {
|
|
return path.join(getDirPath(id), 'doc.pdf')
|
|
}
|
|
|
|
export function getTexCmd(id: string): { cmd: string; options: ExecOptions } {
|
|
return {
|
|
cmd: `pdflatex -interaction nonstopmode ${getDocPath(id)}`,
|
|
options: { cwd: getDirPath(id) },
|
|
}
|
|
}
|