-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(core): allow {args} to be fully interpolated in run-commands #31824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
View your CI Pipeline Execution ↗ for commit 4a36a9c
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds full {args}
interpolation support to the run-commands
executor, refactors the existing argument-forwarding logic into helper functions, and updates tests to cover the new behavior.
- Introduce a
{args}
placeholder branch ininterpolateArgsIntoCommand
- Extract argument-building logic into
unknownOptionsToArgsArray
andunparsedOptionsToArgsArray
- Refactor
readFile
in tests and add a test for{args}
interpolation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
packages/nx/src/executors/run-commands/run-commands.impl.ts | Add {args} interpolation, refactor forwardAllArgs logic, and introduce two helper functions |
packages/nx/src/executors/run-commands/run-commands.impl.spec.ts | Extend readFile helper and add a new test case verifying {args} interpolation |
Comments suppressed due to low confidence (1)
packages/nx/src/executors/run-commands/run-commands.impl.spec.ts:231
- The new test covers interpolation of
__unparsed__
args, but doesn’t verify behavior whenopts.args
is also provided. Adding a test that includes both__unparsed__
andargs
would ensure full coverage of the{args}
branch.
it('should interpolate {args} to contain all provided args', async () => {
…1824) ## Current Behavior Currently, there is no way for a target using `run-commands` to define where in the command args are attached. This is problematic in some tooling cases where args positional location matters ## Expected Behavior Placing `{args}` into the command should allow for interpolation of any and all args provided. Therefore commands can be written such as `docker run {args} imageRef`
…1824) ## Current Behavior Currently, there is no way for a target using `run-commands` to define where in the command args are attached. This is problematic in some tooling cases where args positional location matters ## Expected Behavior Placing `{args}` into the command should allow for interpolation of any and all args provided. Therefore commands can be written such as `docker run {args} imageRef` (cherry picked from commit 434cf45)
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Currently, there is no way for a target using
run-commands
to define where in the command args are attached.This is problematic in some tooling cases where args positional location matters
Expected Behavior
Placing
{args}
into the command should allow for interpolation of any and all args provided.Therefore commands can be written such as
docker run {args} imageRef