File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {
2828 kProjectType ,
2929 ProjectContext ,
3030} from "../../project/types.ts" ;
31+ import { kQuartoScratch } from "../../project/project-scratch.ts" ;
3132
3233import { projectType } from "../../project/types/project-types.ts" ;
3334import { copyResourceFile } from "../../project/project-resources.ts" ;
@@ -804,6 +805,20 @@ export async function renderProject(
804805 projectRenderConfig . behavior . incremental ,
805806 ) ;
806807 }
808+
809+ // in addition to the cleanup above, if forceClean is set, we need to clean up the project scratch dir
810+ // entirely. See options.forceClean in render-shared.ts
811+ // .quarto is really a fiction created because of `--output-dir` being set on non-project
812+ // renders
813+ //
814+ // cf https://github.com/quarto-dev/quarto-cli/issues/9745#issuecomment-2125951545
815+ if ( projectRenderConfig . options . forceClean ) {
816+ const scratchDir = join ( projDir , kQuartoScratch ) ;
817+ if ( existsSync ( scratchDir ) ) {
818+ Deno . removeSync ( scratchDir , { recursive : true } ) ;
819+ }
820+ }
821+
807822 return projResults ;
808823}
809824
You can’t perform that action at this time.
0 commit comments