{"action":"created","comment":{"url":"https://api.github.com/repos/heroku/busl/pulls/comments/34908601","id":34908601,"diff_hunk":"@@ -0,0 +1,73 @@\n+package busltee;\n+\n+import (\n+\t\"log\"\n+\t\"os\"\n+\t\"os/exec\"\n+\t\"syscall\"\n+)\n+\n+func Exec(conf *Config) error {\n+\tcwd, getwdErr := os.Getwd()\n+\tif getwdErr != nil {\n+\t\tlog.Printf(\"count#busltee.exec.getwd.error=1 error=%v\", getwdErr)\n+\t\treturn getwdErr\n+\t}\n+\n+\tprogram, pathErr := exec.LookPath(conf.Program)\n+\tif pathErr != nil {\n+\t\tlog.Printf(\"count#busltee.exec.lookpath.error=1 error=%v\", pathErr)\n+\t\treturn pathErr\n+\t}\n+\n+\tstdoutTeeErr := startTee(conf, cwd, os.Stdout)\n+\tif stdoutTeeErr != nil {\n+\t\tlog.Printf(\"count#busltee.exec.tee.error=1 error=%v\", stdoutTeeErr)\n+\t\treturn stdoutTeeErr\n+\t}\n+ \n+\tstderrTeeErr := startTee(conf, cwd, os.Stderr)","path":"busltee/exec.go","position":29,"original_position":29,"commit_id":"b8491a6bfc8477cb9bec0536321ae186725829e0","original_commit_id":"b8491a6bfc8477cb9bec0536321ae186725829e0","user":{"login":"freeformz","id":103,"avatar_url":"https://avatars.githubusercontent.com/u/103?v=3","gravatar_id":"","url":"https://api.github.com/users/freeformz","html_url":"https://github.com/freeformz","followers_url":"https://api.github.com/users/freeformz/followers","following_url":"https://api.github.com/users/freeformz/following{/other_user}","gists_url":"https://api.github.com/users/freeformz/gists{/gist_id}","starred_url":"https://api.github.com/users/freeformz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeformz/subscriptions","organizations_url":"https://api.github.com/users/freeformz/orgs","repos_url":"https://api.github.com/users/freeformz/repos","events_url":"https://api.github.com/users/freeformz/events{/privacy}","received_events_url":"https://api.github.com/users/freeformz/received_events","type":"User","site_admin":false},"body":"try:\r\n```\r\nif err := startTee(conf, cwd, os.Stderr); err != nil {\r\n  log.Printf(\"count#busltee.exec.tee.error=1 error=%v\", err)\r\n  return err\r\n}\r\n```","created_at":"2015-07-17T16:56:12Z","updated_at":"2015-07-17T16:56:12Z","html_url":"https://github.com/heroku/busl/pull/62#discussion_r34908601","pull_request_url":"https://api.github.com/repos/heroku/busl/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/heroku/busl/pulls/comments/34908601"},"html":{"href":"https://github.com/heroku/busl/pull/62#discussion_r34908601"},"pull_request":{"href":"https://api.github.com/repos/heroku/busl/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/heroku/busl/pulls/62","id":40186788,"html_url":"https://github.com/heroku/busl/pull/62","diff_url":"https://github.com/heroku/busl/pull/62.diff","patch_url":"https://github.com/heroku/busl/pull/62.patch","issue_url":"https://api.github.com/repos/heroku/busl/issues/62","number":62,"state":"open","locked":false,"title":"Rewrite `busltee ... url -- command` as a wrapper, and add `command | busltee ... url` mode.","user":{"login":"ojacobson","id":160985,"avatar_url":"https://avatars.githubusercontent.com/u/160985?v=3","gravatar_id":"","url":"https://api.github.com/users/ojacobson","html_url":"https://github.com/ojacobson","followers_url":"https://api.github.com/users/ojacobson/followers","following_url":"https://api.github.com/users/ojacobson/following{/other_user}","gists_url":"https://api.github.com/users/ojacobson/gists{/gist_id}","starred_url":"https://api.github.com/users/ojacobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojacobson/subscriptions","organizations_url":"https://api.github.com/users/ojacobson/orgs","repos_url":"https://api.github.com/users/ojacobson/repos","events_url":"https://api.github.com/users/ojacobson/events{/privacy}","received_events_url":"https://api.github.com/users/ojacobson/received_events","type":"User","site_admin":false},"body":"This ensures that Busltee itself is not on the signal path for any commands\nit runs. However, this can also cause the started process' output to\ncontinue after the process completes, as the output is relayed through\nchildren which are not terminated immediately.","created_at":"2015-07-16T23:22:02Z","updated_at":"2015-07-17T16:56:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46d3cc6cd5a71eb67478b44682e0e1002e92c52e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/heroku/busl/pulls/62/commits","review_comments_url":"https://api.github.com/repos/heroku/busl/pulls/62/comments","review_comment_url":"https://api.github.com/repos/heroku/busl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heroku/busl/issues/62/comments","statuses_url":"https://api.github.com/repos/heroku/busl/statuses/b8491a6bfc8477cb9bec0536321ae186725829e0","head":{"label":"heroku:exec","ref":"exec","sha":"b8491a6bfc8477cb9bec0536321ae186725829e0","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":20514785,"name":"busl","full_name":"heroku/busl","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/busl","description":"a simple pubsub service that runs on Heroku","fork":false,"url":"https://api.github.com/repos/heroku/busl","forks_url":"https://api.github.com/repos/heroku/busl/forks","keys_url":"https://api.github.com/repos/heroku/busl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/busl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/busl/teams","hooks_url":"https://api.github.com/repos/heroku/busl/hooks","issue_events_url":"https://api.github.com/repos/heroku/busl/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/busl/events","assignees_url":"https://api.github.com/repos/heroku/busl/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/busl/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/busl/tags","blobs_url":"https://api.github.com/repos/heroku/busl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/busl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/busl/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/busl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/busl/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/busl/languages","stargazers_url":"https://api.github.com/repos/heroku/busl/stargazers","contributors_url":"https://api.github.com/repos/heroku/busl/contributors","subscribers_url":"https://api.github.com/repos/heroku/busl/subscribers","subscription_url":"https://api.github.com/repos/heroku/busl/subscription","commits_url":"https://api.github.com/repos/heroku/busl/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/busl/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/busl/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/busl/issues/comments{/number}","contents_url":"https://api.github.com/repos/heroku/busl/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/busl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/busl/merges","archive_url":"https://api.github.com/repos/heroku/busl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/busl/downloads","issues_url":"https://api.github.com/repos/heroku/busl/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/busl/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/busl/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/busl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/busl/labels{/name}","releases_url":"https://api.github.com/repos/heroku/busl/releases{/id}","created_at":"2014-06-05T06:47:54Z","updated_at":"2015-06-26T22:54:59Z","pushed_at":"2015-07-16T23:22:02Z","git_url":"git://github.com/heroku/busl.git","ssh_url":"git@github.com:heroku/busl.git","clone_url":"https://github.com/heroku/busl.git","svn_url":"https://github.com/heroku/busl","homepage":"","size":1587,"stargazers_count":21,"watchers_count":21,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":21,"default_branch":"master"}},"base":{"label":"heroku:master","ref":"master","sha":"52376b8ca5f49d9fe53dfd82aa0c078fa504d88e","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":20514785,"name":"busl","full_name":"heroku/busl","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/busl","description":"a simple pubsub service that runs on Heroku","fork":false,"url":"https://api.github.com/repos/heroku/busl","forks_url":"https://api.github.com/repos/heroku/busl/forks","keys_url":"https://api.github.com/repos/heroku/busl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/busl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/busl/teams","hooks_url":"https://api.github.com/repos/heroku/busl/hooks","issue_events_url":"https://api.github.com/repos/heroku/busl/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/busl/events","assignees_url":"https://api.github.com/repos/heroku/busl/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/busl/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/busl/tags","blobs_url":"https://api.github.com/repos/heroku/busl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/busl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/busl/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/busl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/busl/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/busl/languages","stargazers_url":"https://api.github.com/repos/heroku/busl/stargazers","contributors_url":"https://api.github.com/repos/heroku/busl/contributors","subscribers_url":"https://api.github.com/repos/heroku/busl/subscribers","subscription_url":"https://api.github.com/repos/heroku/busl/subscription","commits_url":"https://api.github.com/repos/heroku/busl/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/busl/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/busl/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/busl/issues/comments{/number}","contents_url":"https://api.github.com/repos/heroku/busl/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/busl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/busl/merges","archive_url":"https://api.github.com/repos/heroku/busl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/busl/downloads","issues_url":"https://api.github.com/repos/heroku/busl/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/busl/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/busl/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/busl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/busl/labels{/name}","releases_url":"https://api.github.com/repos/heroku/busl/releases{/id}","created_at":"2014-06-05T06:47:54Z","updated_at":"2015-06-26T22:54:59Z","pushed_at":"2015-07-16T23:22:02Z","git_url":"git://github.com/heroku/busl.git","ssh_url":"git@github.com:heroku/busl.git","clone_url":"https://github.com/heroku/busl.git","svn_url":"https://github.com/heroku/busl","homepage":"","size":1587,"stargazers_count":21,"watchers_count":21,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heroku/busl/pulls/62"},"html":{"href":"https://github.com/heroku/busl/pull/62"},"issue":{"href":"https://api.github.com/repos/heroku/busl/issues/62"},"comments":{"href":"https://api.github.com/repos/heroku/busl/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/heroku/busl/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/heroku/busl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heroku/busl/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/heroku/busl/statuses/b8491a6bfc8477cb9bec0536321ae186725829e0"}}}}