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

未关闭
#13,751 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@cderv 已经在做这个了。

开始于 2025年12月5日。

评估

这个 Issue 还没有评估数据。

描述

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")
主要语言
JavaScript
星标
6k
派生
458
平均合并
1 天 9 小时
30 天内合并 PR
41

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quarto-dev/quarto-cli 的其他 Issue

查看 quarto-dev/quarto-cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。