Skip to content

Commit 4d5437f

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Get storage paths for repository-specific autofix output
1 parent 05c398f commit 4d5437f

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

extensions/ql-vscode/src/variant-analysis/view-autofixes.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,5 +483,35 @@ async function runAutofixForRepository(
483483
logger: NotificationLogger,
484484
outputTextFiles: string[],
485485
): Promise<void> {
486-
// TODO
486+
// Get storage paths for the autofix results for this repository.
487+
const {
488+
repoAutofixOutputStoragePath,
489+
outputTextFilePath,
490+
transcriptFilePath,
491+
fixDescriptionFilePath,
492+
} = await getRepoStoragePaths(autofixOutputStoragePath, nwo);
493+
}
494+
495+
/**
496+
* Gets the storage paths for the autofix results for a given repository.
497+
*/
498+
async function getRepoStoragePaths(
499+
autofixOutputStoragePath: string,
500+
nwo: string,
501+
) {
502+
// Create output directories for repo's autofix results.
503+
const repoAutofixOutputStoragePath = join(
504+
autofixOutputStoragePath,
505+
nwo.replaceAll("/", "-"),
506+
);
507+
await ensureDir(repoAutofixOutputStoragePath);
508+
return {
509+
repoAutofixOutputStoragePath,
510+
outputTextFilePath: join(repoAutofixOutputStoragePath, "output.txt"),
511+
transcriptFilePath: join(repoAutofixOutputStoragePath, "transcript.md"),
512+
fixDescriptionFilePath: join(
513+
repoAutofixOutputStoragePath,
514+
"fix-description.md",
515+
),
516+
};
487517
}

0 commit comments

Comments
 (0)