Skip to content

Commit 5e36323

Browse files
committed
fix(ci): ensure valid output directory for reports and merged diff
1 parent 701598b commit 5e36323

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/ci/src/lib/cli/commands/merge-diffs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function runMergeDiffs(
1010
files: string[],
1111
{ bin, config, directory, silent }: CommandContext,
1212
): Promise<string> {
13-
const outputDir = join(process.cwd(), DEFAULT_PERSIST_OUTPUT_DIR);
13+
const outputDir = join(directory, DEFAULT_PERSIST_OUTPUT_DIR);
1414
const filename = `merged-${DEFAULT_PERSIST_FILENAME}`;
1515

1616
const { stdout } = await executeProcess({

packages/ci/src/lib/run.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ async function runOnProject(args: RunOnProjectArgs): Promise<ProjectRunResult> {
156156
const reportsDir = path.join(settings.directory, '.code-pushup');
157157
const currPath = path.join(reportsDir, 'curr-report.json');
158158
const prevPath = path.join(reportsDir, 'prev-report.json');
159+
await fs.mkdir(reportsDir, { recursive: true });
159160
await fs.writeFile(currPath, currReport);
160161
await fs.writeFile(prevPath, prevReport);
161162
logger.debug(`Saved reports to ${currPath} and ${prevPath}`);

0 commit comments

Comments
 (0)