Skip to content

Commit 90d05e0

Browse files
authored
Merge pull request #12339 from quarto-dev/bugfix/project-temp-cleanup-2
create temp context correctly
2 parents cb6a2b5 + 169549e commit 90d05e0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/project/project-context.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ export async function projectContext(
362362
} else {
363363
debug(`projectContext: Found Quarto project in ${dir}`);
364364
const temp = createTempContext({
365-
dir: join(dir, ".quarto", "temp"),
365+
dir: join(dir, ".quarto"),
366+
prefix: "quarto-session-temp",
366367
});
367368
const fileInformationCache = new Map();
368369
const result: ProjectContext = {
@@ -410,6 +411,7 @@ export async function projectContext(
410411
cleanup: () => {
411412
cleanupFileInformationCache(result);
412413
result.diskCache.close();
414+
temp.cleanup();
413415
},
414416
};
415417
const { files, engines } = await projectInputFiles(
@@ -433,7 +435,10 @@ export async function projectContext(
433435
dir = originalDir;
434436
configResolvers.shift();
435437
} else if (force) {
436-
const temp = globalTempContext();
438+
const temp = createTempContext({
439+
dir: join(originalDir, ".quarto"),
440+
prefix: "quarto-session-temp",
441+
});
437442
const fileInformationCache = new Map();
438443
const context: ProjectContext = {
439444
resolveBrand: async (fileName?: string) =>
@@ -484,6 +489,7 @@ export async function projectContext(
484489
cleanup: () => {
485490
cleanupFileInformationCache(context);
486491
context.diskCache.close();
492+
temp.cleanup();
487493
},
488494
};
489495
if (Deno.statSync(path).isDirectory) {

0 commit comments

Comments
 (0)