Skip to content

Fix bundled quarto.cmd when the install path contains a space - #15288

Merged
cderv merged 3 commits into
mainfrom
fix-hkpvl-bundled-quarto-cmd-spaces
Nov 4, 2026
Merged

cderv merged 3 commits into
mainfrom
fix-hkpvl-bundled-quarto-cmd-spaces

Conversation

@cderv

@cderv cderv commented Nov 4, 2026

Copy link
Copy Markdown
Member

Follow-up to #15276, which fixed the dev quarto.cmd for a checkout path containing a space and left the bundled branch unchanged on purpose.

The Windows installers ship quarto.cmd next to quarto.exe. Called directly from an install path containing a space, it fails with Permission flags have likely been incorrectly set after the script argument before Quarto starts. quarto.exe is the normal entry point, picked first from PATH and by Quarto itself, and works from the same path, so only direct calls to quarto.cmd are affected.

Root cause

The bundled launch line passed the Deno executable and quarto.js unquoted. cmd still finds deno.exe, but Deno reads its arguments from the raw command line and takes the rest of its own path after the space as the script to run.

Fix

Quote both paths, as the dev launch line already does.

The bundled branch also set QUARTO_IMPORT_MAP_ARG with doubled quotes, to a bin/vendor/import_map.json that installs do not contain. Nothing has passed it to Deno since the .cmd was aligned with the POSIX quarto script, whose bundled branch sets no import map, and quarto.exe passes none either because quarto.js is a bundle with its imports already resolved. The line is removed instead of repaired.

A Windows-only unit test builds a minimal bundled layout under a directory with a space and checks that quarto.cmd runs quarto.js with its arguments. The dev branch and quarto.exe are unchanged.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

cderv added 2 commits November 4, 2026 13:26
The Windows installers ship quarto.cmd next to quarto.exe. Called from an
install path containing a space, its bundled branch failed: the launch
line passed the Deno executable and quarto.js unquoted. cmd still found
deno.exe, but Deno re-parsed the raw command line and took the rest of
its own path as the script, failing with "Permission flags have likely
been incorrectly set after the script argument". quarto.exe was not
affected.

- Quote the Deno executable and quarto.js on the bundled launch line, as
  the dev launch line already does.
- Drop the bundled QUARTO_IMPORT_MAP_ARG. It has not been passed to Deno
  since the .cmd was aligned with the POSIX quarto script, whose bundled
  branch sets no import map, and quarto.exe passes none either: quarto.js
  is a self-contained bundle.
- Add a Windows-only test that builds a minimal bundled layout under a
  directory with a space and checks that quarto.cmd runs quarto.js with
  its arguments.

Follows #15276, which fixed the dev branch.
The runtime boundary check counts Deno.* occurrences in tests as text,
including inside string literals, so the stub quarto.js written by the
test raised the tests count by one and would keep the check red.
node:process reads the same arguments without a Deno global.
@posit-snyk-bot

posit-snyk-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

The test only compared the arguments quarto.js printed, so a launcher
that printed them and then exited with an error would still pass.
@cderv
cderv merged commit cecd6f3 into main Nov 4, 2026
52 checks passed
@cderv
cderv deleted the fix-hkpvl-bundled-quarto-cmd-spaces branch November 4, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants