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

Offen
#13,751 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@cderv arbeitet bereits daran.

Seit 05.12.2025.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

bug extensions file-systems project-scripts
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")
Vorherrschende Sprache
JavaScript
Sterne
6k
Forks
458
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
41

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus quarto-dev/quarto-cli

Alle Issues in quarto-dev/quarto-cli

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.