progrium / entrykit

Entrypoint tools for elegant, programmable containers
443 stars 29 forks source link

Support for task arguments with spaces #14

Closed ssoriche closed 4 years ago

ssoriche commented 4 years ago

Using an entrykit command like:

codep perl -E 'say "hi"'

would throw an error message regarding not being able to find the closing quote. This is due to how the task parameters were being split and passed to exec.Command resulting in:

[ "perl", "-E", "'say", "\"hi\"'" ]

This PR splits arguments on whitespace that's not contained within quotes resulting in:

[ "perl", "-E", "'say \"hi\"'" ]

being passed to exec.Command