hooks: add hook to run arbitrary commands#565
Conversation
| enabled. Default: false | ||
| stdin (str, optional): | ||
| String to send to the stdin of the command. Implicitly disables | ||
| `intearctive`. |
| shell: true | ||
| """ | ||
|
|
||
| if quiet: |
There was a problem hiding this comment.
Can we throw an error if quiet & capture are set? Not 100% sure it's required, but might be nice and avoid some confusion later.
| else: | ||
| in_type = _devnull() | ||
|
|
||
| if env is not None: |
There was a problem hiding this comment.
if env: should be good enough here
| proc = Popen(command, stdin=in_type, stdout=out_err_type, | ||
| stderr=out_err_type, env=env, **kwargs) | ||
| try: | ||
| out, err = proc.communicate(stdin) |
There was a problem hiding this comment.
Probably worth a log statement here detailing the command being ran - probably debug?
|
BTW, awesome set of tests :) |
|
ping - @danielkza I think @ejholmes is likely to release stacker 1.3 this week. Just wanted to give you a heads up in case you want to get this in the next version. |
e7bf96b to
7231794
Compare
|
@phobologic Rebased and updated for your suggestions. Sorry for taking so long, I actually completely forgot I had this PR open. |
|
@danielkza no worries, I figured :) Just wanted to give you the heads up! |
* hooks: add hook to run arbitrary commands * hooks: command: fail if `quiet` and `capture` options are both enabled * hooks: command: log command line before executing
No description provided.