Skip to content

Commit

Permalink
fix: actually consume preprocessors, change comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DukeFerdinand committed Nov 6, 2024
1 parent c6f9cb2 commit a562a6f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/utils/sharedFileProcessorUtils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -244,24 +244,24 @@ export async function processContentForFile(config) {
// 3a. Read the output file contents
let fileContents = await fs.readFile(output, {encoding: 'utf-8'});

// 3c. Run any post-processors
if (config.postProcessors) {
// 3b. Run any pre-processors
if (config.preProcessors) {
for (const processor of config.postProcessors) {
fileContents = processor(fileContents)
}
}

// 3b. Replace template variables in output file
// 3c. Replace template variables in output file
fileContents = templateFiller.replaceTemplateValues(fileContents);

// 3c. Run any post-processors
// 3d. Run any post-processors
if (config.postProcessors) {
for (const processor of config.postProcessors) {
fileContents = processor(fileContents)
}
}

// 3d. Write the final file contents
// 3e. Write the final file contents
if (!await AuroFileHandler.tryWriteFile(output, fileContents)) {
throw new Error(`Error writing "${bareFileName}" file to output ${output}`);
}
Expand Down

0 comments on commit a562a6f

Please sign in to comment.