Skip to content

Commit 31380d6

Browse files
authored
Merge pull request #12329 from quarto-dev/bugfix/project-temp-cleanup
create project temp in correct directory and clean it up.
2 parents 61620dd + e34420f commit 31380d6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/core/temp.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ export function globalTempContext() {
5555
}
5656

5757
export function createTempContext(options?: Deno.MakeTempOptions): TempContext {
58+
if (options?.dir) {
59+
ensureDirSync(options?.dir);
60+
}
5861
let dir: string | undefined = Deno.makeTempDirSync({
59-
...options,
6062
dir: tempDir,
63+
...options,
6164
});
6265

6366
const tempContextCleanupHandlers: VoidFunction[] = [];

src/project/project-context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ export async function projectContext(
265265
}
266266

267267
const temp = createTempContext({
268-
dir: join(dir, ".quarto", "temp"),
268+
dir: join(dir, ".quarto"),
269+
prefix: "quarto-session-temp",
269270
});
270271
const result: ProjectContext = {
271272
resolveBrand: async (fileName?: string) =>
@@ -313,6 +314,7 @@ export async function projectContext(
313314
temp,
314315
cleanup: () => {
315316
result.diskCache.close();
317+
temp.cleanup();
316318
},
317319
};
318320

0 commit comments

Comments
 (0)