Skip to content

Conversation

@gordonwoodhull
Copy link
Contributor

@gordonwoodhull gordonwoodhull commented Dec 24, 2025

Slightly different pattern from other commands:

  • --dry-run: show every operation that would happen (overwrite, copy, remove)
  • --force: skip and confirm all prompts

--no-prompt was too ambiguous because quarto use template does not allow actions; --force is really clear.

In addition to copying and overwriting, the commands will also remove any extra files that were already in the _brand/ folder. This also invokes a prompt listing those files; saying no to removal does not cancel the rest of the command.

--dry-run and --force also report/force potential removals.

gordonwoodhull and others added 8 commits December 23, 2025 21:17
works but --no-prompt is ambiguous
and this needs better error handling
The `quarto use brand` command now installs brand files to `_brand/`
(changed from `brand/`) and supports two flags for controlling behavior:

--no-prompt: Skips trust and confirmation prompts. Fails if the _brand
directory doesn't exist or if files would be overwritten (fail-safe).

--allow-write: Enables directory creation and file overwrites. Can be
combined with --no-prompt for fully automatic operation.

Default behavior (no flags) prompts for all operations: trust
confirmation, directory creation, and file overwrites.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Quarto now looks for brand configuration files in this order:
1. _brand.yml (project root)
2. _brand.yaml (project root)
3. _brand/_brand.yml (subdirectory)
4. _brand/_brand.yaml (subdirectory)

This allows the `quarto use brand` command to install brand files into
a _brand/ subdirectory while maintaining backward compatibility with
existing projects that have _brand.yml in the project root.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace --no-prompt/--allow-write with simpler --force/--dry-run:
- --force: Skip all prompts and confirmations
- --dry-run: Show what would happen without making changes
- Error if both flags used together

Add comprehensive smoke tests (8 scenarios):
- Basic brand installation
- Dry-run mode (nothing created)
- Force overwrites existing, creates new, preserves unrelated files
- Dry-run reports "Would overwrite" vs "Would create" correctly
- Error on --force --dry-run together
- Multi-file brand installation
- Nested directory structure preserved
- Error when no project directory

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add 4 new smoke tests for nested directory edge cases:
- Scenario 9: Nested overwrite/create/preserve in subdirectories
- Scenario 10: Dry-run reports nested paths correctly
- Scenario 11: Creates nested subdirectory when parent exists
- Scenario 12: Dry-run when subdirectory doesn't exist

Total: 12 smoke tests for quarto use brand

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Refactor output to use grouped lists for both dry-run and actual
execution modes. Overwrites are listed first, then creates:

  Would overwrite:
   - _brand.yml

  Would create:
   - logo.png

- Add action type tracking to distinguish create vs overwrite
- Collect files into arrays, output grouped lists at end
- Add filesInSections() test helper for single-pass verification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add behavior to remove files in target _brand/ that don't exist in source:
- --dry-run shows "Would remove:" section
- --force removes silently
- Interactive mode lists files then uses afterConfirm (declining continues)
- Empty directories cleaned up recursively after file removal
- Cross-platform path separator fix using join() instead of string concat

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Dec 24, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants