{"action":"created","issue":{"url":"https://api.github.com/repos/piotrmurach/tty-command/issues/41","repository_url":"https://api.github.com/repos/piotrmurach/tty-command","labels_url":"https://api.github.com/repos/piotrmurach/tty-command/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/piotrmurach/tty-command/issues/41/comments","events_url":"https://api.github.com/repos/piotrmurach/tty-command/issues/41/events","html_url":"https://github.com/piotrmurach/tty-command/issues/41","id":311623585,"number":41,"title":"Print output only on error","user":{"login":"revolter","id":5748627,"avatar_url":"https://avatars0.githubusercontent.com/u/5748627?v=4","gravatar_id":"","url":"https://api.github.com/users/revolter","html_url":"https://github.com/revolter","followers_url":"https://api.github.com/users/revolter/followers","following_url":"https://api.github.com/users/revolter/following{/other_user}","gists_url":"https://api.github.com/users/revolter/gists{/gist_id}","starred_url":"https://api.github.com/users/revolter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revolter/subscriptions","organizations_url":"https://api.github.com/users/revolter/orgs","repos_url":"https://api.github.com/users/revolter/repos","events_url":"https://api.github.com/users/revolter/events{/privacy}","received_events_url":"https://api.github.com/users/revolter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-05T14:02:23Z","updated_at":"2018-04-05T20:45:57Z","closed_at":null,"author_association":"NONE","body":"Is it possible to only print the command output only if it failed?\r\n\r\nSo it would print:\r\n\r\n```\r\n[hash] Running command\r\n```\r\n\r\nwhen it succeeds, and:\r\n\r\n```\r\n[hash] Running command\r\n[hash] ** BUILD FAILED **\r\n[hash] Finished in 2.788 seconds with exit status 65 (failed)\r\n```\r\n\r\nwhen it fails."},"comment":{"url":"https://api.github.com/repos/piotrmurach/tty-command/issues/comments/379071161","html_url":"https://github.com/piotrmurach/tty-command/issues/41#issuecomment-379071161","issue_url":"https://api.github.com/repos/piotrmurach/tty-command/issues/41","id":379071161,"user":{"login":"piotrmurach","id":444312,"avatar_url":"https://avatars3.githubusercontent.com/u/444312?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrmurach","html_url":"https://github.com/piotrmurach","followers_url":"https://api.github.com/users/piotrmurach/followers","following_url":"https://api.github.com/users/piotrmurach/following{/other_user}","gists_url":"https://api.github.com/users/piotrmurach/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrmurach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrmurach/subscriptions","organizations_url":"https://api.github.com/users/piotrmurach/orgs","repos_url":"https://api.github.com/users/piotrmurach/repos","events_url":"https://api.github.com/users/piotrmurach/events{/privacy}","received_events_url":"https://api.github.com/users/piotrmurach/received_events","type":"User","site_admin":false},"created_at":"2018-04-05T20:45:57Z","updated_at":"2018-04-05T20:45:57Z","author_association":"OWNER","body":"Hey Lulian,\r\n\r\nThanks for using the gem! \r\n\r\nThe printers are 'dumb' loggers that output anything. There is currently no such feature. However, the [print_command_exit](https://github.com/piotrmurach/tty-command/blob/master/lib/tty/command/printers/pretty.rb#L30) does allow you to hook into the status of the command. And I can imagine if you keep collecting data from other hooks, the  `print_command_out_data` and `print_command_err_data`, that is, instead of printing collect the lines and display only when the status is not zero. This could work? If you succeed please submit PR and I would be happy to add this type of printer."}}
{"actor":{"display_login":"piotrmurach"}}