{"action":"created","issue":{"url":"https://api.github.com/repos/SamVerschueren/listr/issues/23","repository_url":"https://api.github.com/repos/SamVerschueren/listr","labels_url":"https://api.github.com/repos/SamVerschueren/listr/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/SamVerschueren/listr/issues/23/comments","events_url":"https://api.github.com/repos/SamVerschueren/listr/issues/23/events","html_url":"https://github.com/SamVerschueren/listr/issues/23","id":167401397,"number":23,"title":"Any way to preserve colors in the output?","user":{"login":"okonet","id":11071,"avatar_url":"https://avatars.githubusercontent.com/u/11071?v=3","gravatar_id":"","url":"https://api.github.com/users/okonet","html_url":"https://github.com/okonet","followers_url":"https://api.github.com/users/okonet/followers","following_url":"https://api.github.com/users/okonet/following{/other_user}","gists_url":"https://api.github.com/users/okonet/gists{/gist_id}","starred_url":"https://api.github.com/users/okonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okonet/subscriptions","organizations_url":"https://api.github.com/users/okonet/orgs","repos_url":"https://api.github.com/users/okonet/repos","events_url":"https://api.github.com/users/okonet/events{/privacy}","received_events_url":"https://api.github.com/users/okonet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SamVerschueren/listr/labels/bug","name":"bug","color":"ee0701"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-25T15:55:36Z","updated_at":"2016-09-15T20:02:44Z","closed_at":null,"body":"I'm trying to incorporate this module to lint-staged: https://github.com/okonet/lint-staged/pull/32\r\nand running into a few issues. I'd like to have all errors from subsequent tasks (i.e. linters) be outputted to the console \"as is\". \r\n\r\nSo, the \"right\" way of doing it ATM is like:\r\n\r\n```js\r\nreturn new Promise((resolve, reject) => {\r\n                        execa(res.bin, res.args)\r\n                            .then(() => {\r\n                                resolve(`${linter} passed!`)\r\n                            })\r\n                            .catch(err => {\r\n                                reject(`\r\n🚨  ${linter} found some errors. Please fix them and try committing again.\r\n\r\n${err.stdout}\r\n`\r\n                                )\r\n                            })\r\n                    })\r\n```\r\n\r\nSee https://github.com/okonet/lint-staged/blob/47099e87d059f79ebc7d8bbe5c0e80069704f5bf/src/runScript.js#L14-L27\r\n\r\nThis works fine, but the output looses all the colors. This sucks!\r\n\r\nTo preserve colors, it seems there is no other way as spawning a process with `stdio: \"inherit\"` option passed in. This makes output colored, but at the same time breaks the output of this module. It now appears twice and (worst thing) it cuts some of the stdout output from the task.\r\n\r\n<img width=\"818\" alt=\"2016-07-23 at 11 37\" src=\"https://cloud.githubusercontent.com/assets/11071/17077266/ee79f428-50c9-11e6-8e56-d49b25f3e075.png\">\r\n\r\nI'm wondering what would be a better work around this.\r\n\r\nSee also #16"},"comment":{"url":"https://api.github.com/repos/SamVerschueren/listr/issues/comments/247437286","html_url":"https://github.com/SamVerschueren/listr/issues/23#issuecomment-247437286","issue_url":"https://api.github.com/repos/SamVerschueren/listr/issues/23","id":247437286,"user":{"login":"okonet","id":11071,"avatar_url":"https://avatars.githubusercontent.com/u/11071?v=3","gravatar_id":"","url":"https://api.github.com/users/okonet","html_url":"https://github.com/okonet","followers_url":"https://api.github.com/users/okonet/followers","following_url":"https://api.github.com/users/okonet/following{/other_user}","gists_url":"https://api.github.com/users/okonet/gists{/gist_id}","starred_url":"https://api.github.com/users/okonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okonet/subscriptions","organizations_url":"https://api.github.com/users/okonet/orgs","repos_url":"https://api.github.com/users/okonet/repos","events_url":"https://api.github.com/users/okonet/events{/privacy}","received_events_url":"https://api.github.com/users/okonet/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T20:02:44Z","updated_at":"2016-09-15T20:02:44Z","body":"So do you think this can be work around? I could not find anything yet. "}}
{"actor":{"display_login":"okonet"}}