Skip to content

Commit

Permalink
fix: Fix dir creation on toc.js save
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Nov 5, 2024
1 parent 043c7ac commit c6fe709
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/steps/processPages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {DocInnerProps} from '@diplodoc/client';
import {basename, dirname, extname, join, resolve} from 'path';
import {existsSync, readFileSync, writeFileSync} from 'fs';
import {existsSync, mkdirSync, readFileSync, writeFileSync} from 'fs';
import log from '@diplodoc/transform/lib/log';
import {asyncify, mapLimit} from 'async';
import {bold} from 'chalk';
Expand Down Expand Up @@ -136,6 +136,7 @@ async function saveTocData(transform: (toc: YfmToc, tocDir: string) => YfmToc, f

for (const [path, toc] of tocs) {
const outputPath = join(output, dirname(path), filename + '.js');
mkdirSync(dirname(outputPath), {recursive: true});
writeFileSync(
outputPath,
dedent`
Expand Down

0 comments on commit c6fe709

Please sign in to comment.