Skip to content

Commit

Permalink
fix(ci): ensure valid output directory for reports and merged diff
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Dec 16, 2024
1 parent 701598b commit 5e36323
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ci/src/lib/cli/commands/merge-diffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function runMergeDiffs(
files: string[],
{ bin, config, directory, silent }: CommandContext,
): Promise<string> {
const outputDir = join(process.cwd(), DEFAULT_PERSIST_OUTPUT_DIR);
const outputDir = join(directory, DEFAULT_PERSIST_OUTPUT_DIR);
const filename = `merged-${DEFAULT_PERSIST_FILENAME}`;

const { stdout } = await executeProcess({
Expand Down
1 change: 1 addition & 0 deletions packages/ci/src/lib/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ async function runOnProject(args: RunOnProjectArgs): Promise<ProjectRunResult> {
const reportsDir = path.join(settings.directory, '.code-pushup');
const currPath = path.join(reportsDir, 'curr-report.json');
const prevPath = path.join(reportsDir, 'prev-report.json');
await fs.mkdir(reportsDir, { recursive: true });
await fs.writeFile(currPath, currReport);
await fs.writeFile(prevPath, prevReport);
logger.debug(`Saved reports to ${currPath} and ${prevPath}`);
Expand Down

0 comments on commit 5e36323

Please sign in to comment.