Skip to content

Commit 878eb5c

Browse files
claude: support single-file mode in quarto use brand
Fall back to current working directory when no _quarto.yml project is found, allowing the command to work in single-file mode. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6645d55 commit 878eb5c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/command/use/commands/brand.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ async function ensureBrandDirectory(force: boolean, dryRun: boolean) {
387387
const currentDir = Deno.cwd();
388388
const nbContext = notebookContext();
389389
const project = await projectContext(currentDir, nbContext);
390-
if (!project) {
391-
throw new Error(`Could not find project dir for ${currentDir}`);
392-
}
393-
const brandDir = join(project.dir, "_brand");
390+
// Use project directory if available, otherwise fall back to current directory
391+
// (single-file mode without _quarto.yml)
392+
const baseDir = project?.dir ?? currentDir;
393+
const brandDir = join(baseDir, "_brand");
394394
if (!existsSync(brandDir)) {
395395
if (dryRun) {
396396
info(` Would create directory: _brand/`);

0 commit comments

Comments
 (0)