### Bug description

Vanilla projects (not book or website) cannot use the publish command correctly when a separate output directory is being used. This appears to be a consequence of not being able to correctly find the path to the output file. To reproduce, clone [this template project](https://github.com/AaronGullickson/research-template) and then run:

```bash
quarto publish quarto-pub analysis/analysis.qmd 
```

When I do this, I get the following output:

```
ERROR: NotFound: No such file or directory (os error 2), stat '/Users/aarong/projects/research-template/analysis/_products/analysis.html'

NotFound: No such file or directory (os error 2), stat '/Users/aarong/projects/research-template/analysis/_products/analysis.html'
    at Object.statSync (deno:runtime/js/30_fs.js:322:9)
    at file:///Applications/quarto/bin/quarto.js:121332:18
    at Array.reduce (<anonymous>)
    at normalizePublishFiles (file:///Applications/quarto/bin/quarto.js:121330:45)
    at renderForPublish (file:///Applications/quarto/bin/quarto.js:121282:24)
    at async renderForPublish (file:///Applications/quarto/bin/quarto.js:109061:24)
    at async handlePublish (file:///Applications/quarto/bin/quarto.js:108967:26)
    at async publishDocument (file:///Applications/quarto/bin/quarto.js:121321:38)
    at async publish5 (file:///Applications/quarto/bin/quarto.js:121417:132)
    at async doPublish (file:///Applications/quarto/bin/quarto.js:121373:13)
```

It appears that the problem has to do with how deeply nested the qmd files are in this case. Quarto seems to be expecting it to be only nested one level deep in the project directory structure and as a result tries to find the output directory in the `analysis` subdirectory rather than in the project root directory. Changing the project type to `default` and changing the execution directory to `project` had no effect on this error. Running the command from the `analysis` subdirectory also had no effect.

This is not working as of the nightly release v1.3.326 on RStudio 2022.12.0 Build 353 on Mac OSX. 

Output of `quarto check`:

```
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.326
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.11.2
      Path: /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
      Jupyter: 5.2.0
      Kernels: python3

(|) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      knitr: 1.41
      rmarkdown: 2.18

[✓] Checking Knitr engine render......OK
```

### 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.
- [X] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
dragonstyle
2023-04-17T18:30:13Z
AaronGullickson
bug triaged-to
v1.4
open
Quarto publish does not work with separate output-dir
https://github.com/quarto-dev/quarto-cli/issues/5220