Repository navigation
Fix bundled quarto.cmd when the install path contains a space - #15288
Merged
Merged
Conversation
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.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 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.
1 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #15276, which fixed the dev
quarto.cmdfor a checkout path containing a space and left the bundled branch unchanged on purpose.The Windows installers ship
quarto.cmdnext toquarto.exe. Called directly from an install path containing a space, it fails withPermission flags have likely been incorrectly set after the script argumentbefore Quarto starts.quarto.exeis the normal entry point, picked first fromPATHand by Quarto itself, and works from the same path, so only direct calls toquarto.cmdare affected.Root cause
The bundled launch line passed the Deno executable and
quarto.jsunquoted. cmd still findsdeno.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_ARGwith doubled quotes, to abin/vendor/import_map.jsonthat installs do not contain. Nothing has passed it to Deno since the.cmdwas aligned with the POSIXquartoscript, whose bundled branch sets no import map, andquarto.exepasses none either becausequarto.jsis 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.cmdrunsquarto.jswith its arguments. The dev branch andquarto.exeare unchanged.Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.