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
(PUP-5704) allow array commands in exec resource #8660
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.
code looks good to me, had some documentation and test comments
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.
Hi, this PR already looks great. Do we want to have additional test cases that test having arrays in the other parameters (refresh
, unless
, onlyif
) or did I just miss them?
This change updates the exec resource to accept arrays as command. The new behaviour is enabled for the following parameters: `:comand`, `:onlyif`, `:unless`, `:refresh`. ``` Changing the command to accept an array: command: "/bin/echo *" # executes through shell command: ["/bin/echo *"] # non-existing command "bin/echo *" command: ["/bin/echo *", "*"] # non-existing command "bin/echo *" command: ["/bin/echo", "*"] # executes directly onlyif/unless: '/bin/echo *' # executes one command through shell onlyif/unless: ['/bin/echo *', '/bin/echo $SHELL'] # executes two commands through shell onlyif/unless: [["/bin/echo", "*"]] # executes one command directly onlyif/unless: [["/bin/echo", "*"], ["/bin/echo", "$SHELL"]] # executes two commands directly ```
This change updates the exec resource to accept arrays as command.
The new behavior is enabled for the following parameters:
:comand
,:onlyif
,:unless
,:refresh
.