Repository navigation
Fix bug with multiple input objects to an external command. - #829
Merged
sophiajt merged 1 commit intoOct 14, 2019
Merged
Conversation
thegedge
commented
Oct 14, 2019
| process = process.arg(&arg.replace("$it", &i.as_string()?)); | ||
| } | ||
| } | ||
| format!("{} {}", self.name, itertools::join(args, " ")) |
Contributor
Author
There was a problem hiding this comment.
This is perhaps the biggest point of discussion. Not sure if there's some escaping I'd have to do here to ensure the joined command below will be executed correctly by the shell.
thegedge
commented
Oct 14, 2019
|
|
||
| process = Exec::shell(itertools::join(commands, " && ")) | ||
| } else { | ||
| process = Exec::cmd(&self.name); |
Contributor
Author
There was a problem hiding this comment.
One other thing I noticed here is that we seem to handle arguments here differently than above (stripping quotes). Should stripping quotes be handled at a different layer?
Previously, we would build a command that looked something like this: <ex_cmd> "$it" "&&" "<ex_cmd>" "$it" So that the "&&" and "<ex_cmd>" would also be arguments to the command, instead of a chained command. This commit builds up a command string that can be passed to an external shell.
Contributor
Author
|
Okay, linting errors fixed. Ready for review! |
Contributor
|
Your timing is excellent, we were just talking about getting around to fixing this today. Thanks for the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we would build a command that looked something like this:
So that the "&&" and "<ex_cmd>" would also be arguments to the command, instead of the original intent of chaining commands together (edit: so you can imaging the command
catwould try to look for a file called&&).This PR adds a few things:
nu_combined!macro for tests, so we can assert against both stdout and stderr.