quarto-dev / quarto-dev/quarto-cli

Error when running post-render script of extension with space in path

Open
#13,751 2 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Dec 5, 2025.

bug extensions file-systems project-scripts
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

Hi,

my project resides in a folder that has a space in its folder path (some people have that).

I have an extension and the extension has defined:

title: MWE
author: Maarten Becker
version: 0.0.5
quarto-required: ">=1.8.0"
contributes:
  project:
    project:
      type: book
  metadata:
    project:
      post-render:
        - scripts/echo.sh

I get an error when the script execution should happen.

Steps to reproduce

I created a ZIP with all ingedrients. After decompressing the folder with space in the folder name is present.

MWE WithSpace.zip

Within the folder execute quarto render

Actual behavior

When running I get the error:

ERROR: Error executing '/Users/becker/Entwicklung/MWE': Failed to spawn '/Users/becker/Entwicklung/MWE': No such file or directory (os error 2)

Stack trace:
    at execProcess (file:///Users/becker/quarto-dev/quarto-cli/src/core/process.ts:203:11)
    at runScripts (file:///Users/becker/quarto-dev/quarto-cli/src/command/render/project.ts:976:28)
    at eventLoopTick (ext:core/01_core.js:179:7)
    at async runPostRender (file:///Users/becker/quarto-dev/quarto-cli/src/command/render/project.ts:924:3)
    at async renderProject (file:///Users/becker/quarto-dev/quarto-cli/src/command/render/project.ts:853:7)
    at async Command.actionHandler (file:///Users/becker/quarto-dev/quarto-cli/src/command/render/cmd.ts:251:26)
    at async Command.execute (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1948:7)
    at async Command.parseCommand (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1780:14)
    at async quarto (file:///Users/becker/quarto-dev/quarto-cli/src/quarto.ts:193:5)
    at async file:///Users/becker/quarto-dev/quarto-cli/src/quarto.ts:225:5

The reason for this is that the absolute path created from the relative path in the extension folder is scrambled in function
https://github.com/quarto-dev/quarto-cli/blob/3b905a23928ddcd582edcc9ace978a9294f15558/src/core/run/shell.ts#L8
where script and arguments are separated simply by splitting at spaces.

With debug statements I see before this function /Users/becker/Entwicklung/MWE WithSpace/_extensions/MWE/scripts/echo.sh as path and after {"0":"/Users/becker/Entwicklung/MWE","1":"WithSpace/_extensions/MWE/scripts/echo.sh"}. The first element is then used as executable and the next as argument.

Expected behavior

Well, no error and script execution...

Your environment
  • IDE: bash, vim
  • OS: Mac OS Sequoia 15.7.2
Quarto check output

I used a fresh v1.9 local build to debug:

Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /Users/becker/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      NOTE: Deno version 2.4.5 does not strictly match 2.3.1 and strict checking is enabled. Please use 2.3.1.
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 25bdae61f21f106468b001525ea3a490ba8e0cf3
      Path: /Users/becker/quarto-dev/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2025.12
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/becker/Library/TinyTeX/bin/universal-darwin
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Chrome:  (not detected)

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

[✓] Checking Python 3 installation....OK
      Version: 3.14.0
      Path: /opt/homebrew/opt/python@3.14/bin/python3.14
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.5.2
      Path: /opt/homebrew/Cellar/r/4.5.2/lib/R
      LibPaths:
        - /opt/homebrew/Cellar/r/4.5.2/lib/R/library
      knitr: 1.50
      rmarkdown: (None)

      The rmarkdown package is not available in this R installation.
      Install with install.packages("rmarkdown")

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.