### Bug description

There is a code path we have where literal file names are treated as globs for resource resolution, which leads to files with similar paths in alternate output dirs (e.g. from a `--profile` render) being vacuumed up as resources when they shouldn't.

Here is a repro from @cwickham : https://github.com/cwickham/dir_exclude

The extra file is getting picked up right here: https://github.com/quarto-dev/quarto-cli/blob/7902764a0b5d4e9a67b9459a8ec08c5c3fa055bd/src/command/render/resources.ts#L53

If I change the globs as follows: ``globs.map((glob) => `./${glob}`)`` then the issue goes away (as the `./` prefix causes it to only match on file paths from the root)

I was going to make this fix but then realized that there is an awful lot going on with resources/globs and I don't want to break anything unwittingly. @dragonstyle Hopefully this gives you enough context to figure out what the right fix is.



### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
dragonstyle
2023-02-26T12:42:52Z
jjallaire
bug
v1.3
closed
resource files can end up globing up outputs from other directories
https://github.com/quarto-dev/quarto-cli/issues/4544