1
0
Fork 0
mirror of https://github.com/Luzifer/streamdeck.git synced 2024-12-20 17:51:21 +00:00

[exec] Allow waiting for command to finish

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-04-17 19:15:42 +02:00
parent 73162a3dda
commit 4cf347407a
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -35,5 +35,11 @@ func (actionExec) Execute(attributes map[string]interface{}) error {
return errors.Wrap(err, "Unable to start command") return errors.Wrap(err, "Unable to start command")
} }
// If "wait" is set and set to true start command and wait for execution
if v, ok := attributes["wait"].(bool); ok && v {
return errors.Wrap(command.Wait(), "Unable to execute command")
}
// We don't wait so we release the process and don't care anymore
return errors.Wrap(command.Process.Release(), "Unable to release process") return errors.Wrap(command.Process.Release(), "Unable to release process")
} }