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(exec): only pass script args to script #11957

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Feb 26, 2025

Let's say you run this command:
yarn rw exec normalScript positional1 --no-prisma positional2 --arg1=foo --arg2 bar -s

What Redwood will do is run your scrip named normalScript. It will also pass it the two positional arguments 'positional1' and 'positional2'. Plus the two named arguments arg1 and arg2 with the values 'foo' and 'bar' respectively. It will also read --no-prisma and skip generating a prisma client, and -s to run the script in silent mode.

What it would also do however is pass a bunch of extra stuff to the script, including the 'exec' word. This PR cleans all that up to only pass the actual script arguments to the script.

This is breaking because people might have been counting on those extra arguments to be passed to the script. Especially 'exec'because it gets passed to the script as part of the _ array. It was the first element, and (in this example) 'positional1' and 'positional2' would have come after it. So if people were expecting their first positional argument to be at args._[1] their script will now break.

@Tobbe Tobbe added the release:breaking This PR is a breaking change label Feb 26, 2025
@Tobbe Tobbe added this to the next-release-major milestone Feb 26, 2025
@Tobbe Tobbe enabled auto-merge (squash) February 27, 2025 08:18
@Tobbe Tobbe merged commit 11c88f0 into redwoodjs:main Feb 27, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant