{"action":"created","issue":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/32","labels_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/32/comments","events_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/32/events","html_url":"https://github.com/Gabriel439/Haskell-Turtle-Library/issues/32","id":60509102,"number":32,"title":"Capturing shell output and exit status?","user":{"login":"houshuang","id":61575,"avatar_url":"https://avatars.githubusercontent.com/u/61575?v=3","gravatar_id":"","url":"https://api.github.com/users/houshuang","html_url":"https://github.com/houshuang","followers_url":"https://api.github.com/users/houshuang/followers","following_url":"https://api.github.com/users/houshuang/following{/other_user}","gists_url":"https://api.github.com/users/houshuang/gists{/gist_id}","starred_url":"https://api.github.com/users/houshuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houshuang/subscriptions","organizations_url":"https://api.github.com/users/houshuang/orgs","repos_url":"https://api.github.com/users/houshuang/repos","events_url":"https://api.github.com/users/houshuang/events{/privacy}","received_events_url":"https://api.github.com/users/houshuang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-10T14:37:24Z","updated_at":"2015-03-10T19:12:47Z","closed_at":null,"body":"Maybe I'm misunderstanding, but it seems to me that when running an external shell command, I can choose between capturing either the exit code, through `shell`, which prints the output and returns the exit code, or capturing the output through `inproc`, which returns the output as a stream, but not the exit code? Instead of `ExitCode`, could we do something like `data Result = ExitSuccess Shell Text | ExitFailure Int`? So that I can pattern match and say if success, do something with the output, if failure, do something else... It could also return a stream with the exit code I guess.\r\n\r\nIt seems like you might be able to wrap `shell` with `liftIO` to get this effect?"},"comment":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/comments/78125978","html_url":"https://github.com/Gabriel439/Haskell-Turtle-Library/issues/32#issuecomment-78125978","issue_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/32","id":78125978,"user":{"login":"houshuang","id":61575,"avatar_url":"https://avatars.githubusercontent.com/u/61575?v=3","gravatar_id":"","url":"https://api.github.com/users/houshuang","html_url":"https://github.com/houshuang","followers_url":"https://api.github.com/users/houshuang/followers","following_url":"https://api.github.com/users/houshuang/following{/other_user}","gists_url":"https://api.github.com/users/houshuang/gists{/gist_id}","starred_url":"https://api.github.com/users/houshuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houshuang/subscriptions","organizations_url":"https://api.github.com/users/houshuang/orgs","repos_url":"https://api.github.com/users/houshuang/repos","events_url":"https://api.github.com/users/houshuang/events{/privacy}","received_events_url":"https://api.github.com/users/houshuang/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T19:12:47Z","updated_at":"2015-03-10T19:12:47Z","body":"OK, so Shell Text is a stream, that makes sense (sorry, just learning about this library). \r\n\r\nIn this particular case, I wanted to do `git ls-files` on a directory and capture the output if it succeeded, and run `find . -type d` if it failed."}}