Skip to content

fix(shell): support redirection-only commands#7166

Open
StantonMatt wants to merge 1 commit into
yarnpkg:masterfrom
StantonMatt:fix-shell-redirection-only
Open

fix(shell): support redirection-only commands#7166
StantonMatt wants to merge 1 commit into
yarnpkg:masterfrom
StantonMatt:fix-shell-redirection-only

Conversation

@StantonMatt
Copy link
Copy Markdown

Fixes #3986.

This teaches @yarnpkg/shell to execute redirection-only command nodes directly instead of trying to spawn an undefined command name. It covers input/output/append redirection-only forms, subshell interpolation such as $(< file), env assignment with redirection, and pipeline shutdown cases where downstream commands stop reading early.

Verification:

  • YARN_ENABLE_GLOBAL_CACHE=0 yarn test:unit packages/yarnpkg-shell/tests/shell.test.ts --runInBand
  • YARN_ENABLE_GLOBAL_CACHE=0 yarn eslint packages/yarnpkg-shell/sources/index.ts packages/yarnpkg-shell/sources/pipe.ts packages/yarnpkg-shell/tests/shell.test.ts
  • YARN_ENABLE_GLOBAL_CACHE=0 yarn typecheck:all
  • YARN_ENABLE_GLOBAL_CACHE=0 yarn version check
  • git diff --check

@StantonMatt StantonMatt marked this pull request as ready for review June 2, 2026 19:11
@StantonMatt StantonMatt force-pushed the fix-shell-redirection-only branch from 717ae97 to 09d3716 Compare June 2, 2026 22:35
Fixes yarnpkg#3986.

Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
@StantonMatt StantonMatt force-pushed the fix-shell-redirection-only branch from 09d3716 to dc5eb75 Compare June 2, 2026 22:59
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.

[Bug]: The "file" argument must be of type string. Received undefined

1 participant