Skip to content

fix(shell): preserve pathname expansion in scripts - #705

Open
RSS1102 wants to merge 5 commits into
voidzero-dev:mainfrom
RSS1102:rss1102/fix-package-script-shell-globs
Open

fix(shell): preserve pathname expansion in scripts#705
RSS1102 wants to merge 5 commits into
voidzero-dev:mainfrom
RSS1102:rss1102/fix-package-script-shell-globs

Conversation

@RSS1102

@RSS1102 RSS1102 commented Aug 30, 2026

Copy link
Copy Markdown

Motivation

Package scripts rely on platform-specific shell semantics. On Unix, Vite Task's static command path flattened unquoted patterns such as packages/*/src into literal arguments instead of allowing the package-script shell to perform pathname expansion, so vp run behaved differently from package managers.

The task runner should preserve those native semantics without introducing its own cross-platform glob language. Commands that want portable glob behavior can own it explicitly by receiving a quoted pattern unchanged, for example vp lint "packages/*/src".

Fixes #573.

Summary

  • preserve unquoted pathname-expansion characters for Unix shell execution
  • keep Windows on the static command path because cmd.exe does not expand pathname patterns
  • keep quoted, escaped, and assignment-value patterns on the static path for the child command to interpret
  • cover parser decisions, execution plans, nested vt run, quoted command-owned patterns, extra arguments, exit codes, and platform-specific behavior with regression tests
  • scope the changelog entry to Unix package-script shell expansion

@RSS1102
RSS1102 force-pushed the rss1102/fix-package-script-shell-globs branch 3 times, most recently from 477b3b7 to 150b596 Compare August 31, 2026 03:23
Co-authored-by: GPT-5 Codex <codex@openai.com>
@RSS1102
RSS1102 force-pushed the rss1102/fix-package-script-shell-globs branch from 150b596 to 31ac7b6 Compare August 31, 2026 09:04
@RSS1102
RSS1102 marked this pull request as ready for review September 1, 2026 03:06
@RSS1102

RSS1102 commented Sep 1, 2026

Copy link
Copy Markdown
Author

@TheAlexLichter

This PR preserves the native package-script behavior on each platform:

  • Unix shells expand unquoted globs such as packages/*/src.
  • Windows cmd.exe does not expand globs, so the pattern is passed unchanged.
    vp run should not expand globs itself because it cannot know which arguments are file patterns. Portable glob support should be implemented by file-oriented commands such as vp lint.
    Once supported, the cross-platform usage would be:

Windows

"lint": "vp lint \"packages/*/src\""

Quoting ensures that vp lint receives the same pattern on every platform.

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.

vp run does not preserve shell semantics for package.json scripts

1 participant