Skip to content
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

fix(core): run-commands should not parse strings as numbers #17670

Merged

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Jun 19, 2023

Current Behavior

When passing command line args to a target using nx:run-commands whose value resembles a number, it is being parsed as a number.

This can cause erroneous behaviour when the intention of the value is to be a string.

The main potential of erroneous behaviour here comes from decimal numbers ending in 0, such as 1234.10. When this is parsed as a number then converted back to a string for interpolation, this value becomes 1234.1.

Expected Behavior

Args that are passed to the nx:run-commands via command line should not be parsed as numbers.

We should leave support args that are passed as options in the project.json

Related Issue(s)

Fixes #17575

@Coly010 Coly010 requested a review from a team as a code owner June 19, 2023 10:53
@Coly010 Coly010 requested a review from AgentEnder June 19, 2023 10:53
@Coly010 Coly010 self-assigned this Jun 19, 2023
@vercel
Copy link

vercel bot commented Jun 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2023 2:48pm

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zero gets stripped from run-commands arguments
2 participants