build-docx cannot handle build/release as an output directory #4

Closed
opened 2025-09-21 17:56:59 +00:00 by dmoonfire · 0 comments
Owner

When a publication.yaml file has an output directory, generating an .docx file causes an error.

23:04:41 docx: Writing out HTML: /tmp/tmp-5257387wlns8gNXvbM/build/release/dmoonfire-0037-00-allegro-0.43.10.docx.html
23:04:41 There was an error running
 Error: ENOENT: no such file or directory, open '/tmp/tmp-5257387wlns8gNXvbM/build/release/dmoonfire-0037-00-allegro-0.43.10.docx.html'
    at Object.writeFileSync (node:fs:2425:20)
    at /nix/store/vjpz956y8iscqyzbxmzqpz12yvif6mrx-node-dependencies-fedran-writing-setup-0.0.1/lib/node_modules/@mfgames-writing/docx-format/src/DocxFormatter.ts:139:16
    at async Promise.all (index 0) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/tmp/tmp-5257387wlns8gNXvbM/build/release/dmoonfire-0037-00-allegro-0.43.10.docx.html'
}

The publication.json file starts with:

{
  "metadata": {
    "title": "Allegro",
    "author": "D. Moonfire",
    "language": "en",
    "theme": "@fedran/writing-theme",
    "outputDirectory": "build/release",
    "outputFilename": "dmoonfire-{{{{edition.fedran.pov}}-{{{{edition.fedran.volume}}-{{{{edition.fedran.slug}}-{{{{edition.version}}.{{{{edition.ext}}",
When a `publication.yaml` file has an output directory, generating an `.docx` file causes an error. ``` 23:04:41 docx: Writing out HTML: /tmp/tmp-5257387wlns8gNXvbM/build/release/dmoonfire-0037-00-allegro-0.43.10.docx.html 23:04:41 There was an error running Error: ENOENT: no such file or directory, open '/tmp/tmp-5257387wlns8gNXvbM/build/release/dmoonfire-0037-00-allegro-0.43.10.docx.html' at Object.writeFileSync (node:fs:2425:20) at /nix/store/vjpz956y8iscqyzbxmzqpz12yvif6mrx-node-dependencies-fedran-writing-setup-0.0.1/lib/node_modules/@mfgames-writing/docx-format/src/DocxFormatter.ts:139:16 at async Promise.all (index 0) { errno: -2, code: 'ENOENT', syscall: 'open', path: '/tmp/tmp-5257387wlns8gNXvbM/build/release/dmoonfire-0037-00-allegro-0.43.10.docx.html' } ``` The `publication.json` file starts with: ```json { "metadata": { "title": "Allegro", "author": "D. Moonfire", "language": "en", "theme": "@fedran/writing-theme", "outputDirectory": "build/release", "outputFilename": "dmoonfire-{{{{edition.fedran.pov}}-{{{{edition.fedran.volume}}-{{{{edition.fedran.slug}}-{{{{edition.version}}.{{{{edition.ext}}", ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mfgames-writing-js/mfgames-writing-js#4
No description provided.