-
Notifications
You must be signed in to change notification settings - Fork 36
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(foreach): supports quoted commands #132
Conversation
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.
Thanks for your contribution and great finding,
I left a small suggestion about the string builder.
Also could you rename the PR with something about what it fixes which is quoted commands in foreach
?
Ideally something standard like
fix(foreach): supports quoted commands
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.
LGTM now, but could you now add some unit tests around this fix?
3472e9f
to
4b805f5
Compare
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.
LGTM, thank you for your contribution!
I think this breaks intended usages. Turbolift invokes a shell specifically to support invoking commands with pipes. So you can do things like this (slightly contrived).
If I understand correctly, this will cause that entire string to be quoted when passed to the shell, and then fail as an unrecognised command. I do think that as it stood the handling for multiple arguments was a bit confused, but I'm worried this confuses things further. I think turbolift needs to sit on one side of this fence, and pick one of the following behaviours:
Some other concerns I have about this solution:
I'll have a look at how this behaves in practice and raise a ticket. |
This PR allows to execute foreach commands with parameters that include spaces.
Also improves the code by reusing the same command slice for all the repositories.