rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
129 stars 79 forks source link

quarto: project paths having spaces are not correctly inspected #1037

Closed aronatkins closed 5 months ago

aronatkins commented 5 months ago

Given a project where some part of the path contains spaces:

# Create a project having spaces.
usethis::create_project("~/Desktop/quarto space path")

# In that new project:
writeLines(c(
    "---",
    "title: space is fun",
    "---"
), "index.qmd")
rsconnect:::quartoInspect(getwd(), "index.qmd") 
# => NULL

The quartoInspect call should return an object describing the Quarto content rather than NULL.

Internally, this is because:

system2(rsconnect:::quarto_path(), c("inspect", file.path(getwd(), "index.qmd")), stdout = TRUE, stderr = TRUE)
[1] "\033[91mERROR: Too many arguments: space path/index.qmd"                          
[2] ""                                                                                 
[3] "Stack trace:"                                                                     
[4] "    at Command.parseArguments (file:///Applications/quarto/bin/quarto.js:8268:27)"
[5] "    at Command.parseCommand (file:///Applications/quarto/bin/quarto.js:7987:31)"  
[6] "    at eventLoopTick (ext:core/01_core.js:183:11)"                                
[7] "    at async quarto (file:///Applications/quarto/bin/quarto.js:114968:5)"         
[8] "    at async file:///Applications/quarto/bin/quarto.js:114986:9\033[39m"          
attr(,"status")
[1] 1
Warning message:
In system2(rsconnect:::quarto_path(), c("inspect", file.path(getwd(),  :
  running command ''/usr/local/bin/quarto' inspect /Users/aron/Desktop/quarto space path/index.qmd 2>&1' had status 1
aronatkins commented 5 months ago

Would have been good to have had #1032, though this is a different root problem.

aronatkins commented 5 months ago

Note: Customer ticket 99719

ChaitaC commented 5 months ago

Verified with the latest rsconnect dev version

GithubRepo: rsconnect
GithubUsername: rstudio
GithubRef: HEAD
GithubSHA1: 2e59f9d56651189487e195a8140baebe580d3476