Skip to content

Commit

Permalink
fix(batch): cleanup redundant results property
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastrajan committed Mar 20, 2023
1 parent 6dcc809 commit 7d0648b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/batch/tasks/batch-save-project-json.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function batchSaveProjectJsonTaskFactory(job: string): ListrTask {
enabled: (ctx: Context) => ctx.options.json,
task: async (ctx: Context, task) => {
const path = `../_dist/${getRepoNameFromUrl(job)}.json`;
fs.writeJson(path, ctx.processedResults);
fs.writeJson(path, ctx.results);
task.title = `${task.title}, saved to: ${path}`;
},
};
Expand Down
1 change: 0 additions & 1 deletion lib/batch/tasks/finalize-job.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export function finalizeJobTaskFactory(
ctx.control = { skipEverySubsequentTask: false };
ctx.results = { checks: {} };
ctx.handledCheckFailures = [];
ctx.processedResults = undefined;

// reset cwd
process.chdir('../../');
Expand Down
1 change: 0 additions & 1 deletion lib/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export interface Context {
};
};
handledCheckFailures: Error[];
processedResults?: any;
batch: Batch;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/print-project-cli-output.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const printProjectCliOutputTask: ListrTask = {
title: 'Print project results (CLI output)',
skip: (ctx: Context) => ctx.control.skipEverySubsequentTask,
task: (ctx: Context, task) => {
console.log(JSON.stringify(ctx.processedResults ?? {}, null, 2));
console.log(JSON.stringify(ctx.results ?? {}, null, 2));
process.exit(0);
},
options: {
Expand Down

0 comments on commit 7d0648b

Please sign in to comment.