# Bug description

When my working directory on my Mac is within a Google Drive folder that is shared with my Google Drive account (reached via shortcut), Quarto does not respect the `execute-dir: project` option. This can cause problems with rendering if you have referenced other files assuming the main project directory is the working directory. I suspect this is a larger issue than just the `execute-dir` option (Google Drive does weird things with these shortcut folders), and it might not even be fixable on your end, but I wanted to flag it just in case. Also, just using `execute-dir: file` and changing all my file references isn't a great option, because then the code doesn't work interactively, when my working directory IS the project directory. 

## Reprex

1. Install the Google Drive desktop app for Mac
2. Create a Quarto project within a directory that is shared with your google drive account (access it by creating a shortcut to that directory in your Google Drive 'My Drive' folder), add the following to the `_quarto.yml` file:
    ```
    project:
      title: "test"
      execute-dir: project
    ```
4. To demonstrate the issue, create a subdirectory called `code` within the project folder. Create two files within this subdirectory, with the following contents: 

    test.R
    ```
    print("hello, world")
    ```
    
    test.qmd
    ````
    ---
    title: "test"
    format: html
    execute-dir: project
    ---
    
    ```{r}
    source("code/test.R")
    ```
    ````
5. Attempt to render this `.qmd` file (or project). The render will fail with the following error: 
    ```
    Quitting from lines 8-9 (test.qmd) 
    
    Error in file(filename, "r", encoding = encoding) : 
      cannot open the connection
    Calls: .main ... eval_with_user_handlers -> eval -> eval -> source -> file
    Execution halted
    ```

## System Stats

Results of `quarto check`: 
```
[✓] Checking Quarto installation......OK
      Version: 0.9.637
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.6 (Conda)
      Path: /Users/connor/opt/miniforge/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      rmarkdown: 2.14

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

RStudio Version `2022.02.3 Build 492`. Session Info: 
```
R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.2.1 tools_4.2.1   
```

# Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, self-contained, and reproducible example?
- [X] documented the quarto version you're running, by providing the output produced by `quarto check` in a terminal in your issue?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-07-06T01:39:48Z
connorp
bug
Future
open
Quarto does not respect execute-dir in Google Drive Shared Directories
https://github.com/quarto-dev/quarto-cli/issues/1293