diff --git a/src/docs.mts b/src/docs.mts index 738e4c9c9..cf5f54ae9 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -100,9 +100,9 @@ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { * documentation directory. Default is `false` */ const copyTransformedContents = ( - file: string, - transformedContent?: string, - doCopy: boolean = false + filename: string, + doCopy: boolean = false, + transformedContent?: string ) => { const fileInFinalDocDir = changeToFinalDocDir(file); const existingBuffer = existsSync(fileInFinalDocDir) @@ -152,6 +152,7 @@ const transformMarkdown = (file: string) => { copyTransformedContents( file, + !verifyOnly, prettier.format(transformed, { parser: 'markdown', useTabs: false, @@ -159,8 +160,7 @@ const transformMarkdown = (file: string) => { endOfLine: 'auto', printWidth: 100, singleQuote: true, - }), - !verifyOnly + }) ); }; @@ -191,7 +191,7 @@ const transformHtml = (filename: string) => { }; const transformedHTML = insertAutoGeneratedComment(filename); - copyTransformedContents(filename, transformedHTML, !verifyOnly); + copyTransformedContents(filename, !verifyOnly, transformedHTML); }; /** Main method (entry point) */ @@ -214,8 +214,7 @@ const transformHtml = (filename: string) => { dot: includeFilesStartingWithDot, }); otherFiles.forEach((file: string) => { - const transformedContents = readSyncedUTF8file(file); // no transformation is done; just get the contents - copyTransformedContents(file, transformedContents, !verifyOnly); + copyTransformedContents(file, !verifyOnly); // no transformation }); if (filesWereTransformed) {