Only split "commands" on semicolon #7192
Merged
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.
The SSH task can execute a set of commands, a script file, or an inline script. When running the first option, it would split the input on newlines and then send those lines to a method that split them again on semicolons and finally send each string separately as a command. To run the latter two, the task would create a command to run a file like,
<script path> <args>
, and then it would then pass this to the same method that used above. So if<args>
had a semicolon in it, the task would incorrectly split on that semicolon.The fix here is to only split on semicolons in the first case, so I moved the splitting out from the helper method to the only place that uses it.