Skip to content

Commit a052220

Browse files
committed
Fix quarto inspect emitting project for standalone files in RStudio
Current RStudio releases assume project.dir in quarto inspect output implies a _quarto.yml exists. Since f6a0f89 (v1.9.35), standalone files always get a project context for engine extension resolution, which causes inspect to emit project.dir for standalone files. RStudio then adds _quarto.yml to the deploy list, file.info() returns NA, and the publishing wizard crashes. Gate the project emission on !(isSingleFile && isRStudio()) so current RStudio releases continue to work. The RStudio-side fix is in rstudio/rstudio#17336. Fixes rstudio/rstudio#17333
1 parent 7718ad7 commit a052220

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/inspect/inspect.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
import { validateDocumentFromSource } from "../core/schema/validate-document.ts";
5050
import { error } from "../deno_ral/log.ts";
5151
import { ProjectContext } from "../project/types.ts";
52+
import { isRStudio } from "../core/platform.ts";
5253

5354
export function isProjectConfig(
5455
config: InspectedConfig,
@@ -238,7 +239,9 @@ const inspectDocumentConfig = async (path: string) => {
238239
};
239240

240241
// if there is a project then add it
241-
if (context?.config) {
242+
// Suppress project for standalone files in RStudio: current releases
243+
// assume project.dir implies _quarto.yml exists (rstudio/rstudio#17333)
244+
if (context?.config && !(context.isSingleFile && isRStudio())) {
242245
config.project = await inspectProjectConfig(context);
243246
}
244247
return config;

0 commit comments

Comments
 (0)