Skip to content

Commit

Permalink
fix: correct counting of built files
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Jul 7, 2022
1 parent 4876efd commit cd5791f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const build = async () => {
workflowFilesPaths.map(item => `-> ${relativePath(item)}`).join("\n")
);

let builtFilesCount = 0;
for (let i = 0; i < workflowFilesPaths.length; i++) {
const tsWorkflowPath = workflowFilesPaths[i];
const exportedWorkflows = await import(tsWorkflowPath);
Expand All @@ -47,12 +48,13 @@ export const build = async () => {
log("%s", `\n${content}`);

fs.writeFileSync(yamlWorkflowPath, [TOP_YAML_WORKFLOW_COMMENT, content].join("\n"));
builtFilesCount++;
}
}

// For the "watch" command, we need to flush the cached imported files. Otherwise, once imported, the
// above dynamic imports will always just returned cached imported objects and no change will happen.
clearImportCache();

console.log(`Successfully generated ${workflowFilesPaths.length} file(s).`);
console.log(`Successfully built ${builtFilesCount} file(s).`);
};

0 comments on commit cd5791f

Please sign in to comment.