-
Notifications
You must be signed in to change notification settings - Fork 225
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
run_command: support an array of commands #3336
base: main
Are you sure you want to change the base?
Conversation
* **run_command: support an array of commands* ([puppetlabs#3333](puppetlabs#3333)) Added run_commands method which allows an array of commands to be passed to run_command
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.
This does not address the use case described in the issue. The request is to mirror the pattern in puppet's exec to be more explicit about parameterization. The example they give is: command => ['/bin/echo', 'hello world; rm -rf /']
. Your PR here would do:
/bin/echo && hello world; rm -rf /
which is absolutely not what we want.
Properly implementing this feature will involve making a similar change to how we use the underlying Open3 lib to take advantage of the explicit parameterization features.
Wondering if it would be acceptable splitting commands, then escaping each argument and then lastly joining arguments again into a single command? This way in [‘/bin/echo', 'hello world; rm -rf /'] the second command won’t run at all My latest commit reflects those changes |
I think you are misunderstanding the feature request. it is not to be able to run multiple commands in the same invocation of the function. Instead it is to support explicit parameters to a single command. |
!feature
*run_command: support an array of commands (#3333)
Added run_commands method which allows an array of commands to be passed to run_command