{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/cp-file/pulls/comments/70795803","id":70795803,"diff_hunk":"@@ -40,6 +34,35 @@ module.exports = function (src, dest, opts) {\n \t\tread.on('end', function () {\n \t\t\tresolve(read);\n \t\t});\n+\t});\n+};\n+\n+function statSource(src, progress) {\n+\tif (progress.enabled) {\n+\t\treturn fsP.stat(src).then(function(stat) {\n+\t\t\tprogress.stat = stat;\n+\t\t}).catch(function(err) {\n+\t\t\tPromise.reject(new CpFileError('NO_ENTRY', err));\n+\t\t});\n+\t}\n+\treturn Promise.resolve();","path":"index.js","position":35,"original_position":35,"commit_id":"6a08f25bc384515f033fad0d2fca65ae575aeacd","original_commit_id":"6a08f25bc384515f033fad0d2fca65ae575aeacd","user":{"login":"schnittstabil","id":6059032,"avatar_url":"https://avatars.githubusercontent.com/u/6059032?v=3","gravatar_id":"","url":"https://api.github.com/users/schnittstabil","html_url":"https://github.com/schnittstabil","followers_url":"https://api.github.com/users/schnittstabil/followers","following_url":"https://api.github.com/users/schnittstabil/following{/other_user}","gists_url":"https://api.github.com/users/schnittstabil/gists{/gist_id}","starred_url":"https://api.github.com/users/schnittstabil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schnittstabil/subscriptions","organizations_url":"https://api.github.com/users/schnittstabil/orgs","repos_url":"https://api.github.com/users/schnittstabil/repos","events_url":"https://api.github.com/users/schnittstabil/events{/privacy}","received_events_url":"https://api.github.com/users/schnittstabil/received_events","type":"User","site_admin":false},"body":"Improve the readability, by lowering the nesting:\r\n```js\r\nif (!progress.enabled) {\r\n  return Promise.resolve();\r\n}\r\n\r\nreturn fsP.stat(src).then(function(stat) {\r\n// …\r\n```\r\n","created_at":"2016-07-14T12:28:06Z","updated_at":"2016-07-14T12:28:07Z","html_url":"https://github.com/sindresorhus/cp-file/pull/9#discussion_r70795803","pull_request_url":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/cp-file/pulls/comments/70795803"},"html":{"href":"https://github.com/sindresorhus/cp-file/pull/9#discussion_r70795803"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9","id":77438408,"html_url":"https://github.com/sindresorhus/cp-file/pull/9","diff_url":"https://github.com/sindresorhus/cp-file/pull/9.diff","patch_url":"https://github.com/sindresorhus/cp-file/pull/9.patch","issue_url":"https://api.github.com/repos/sindresorhus/cp-file/issues/9","number":9,"state":"open","locked":false,"title":"Add progress reporting","user":{"login":"YurySolovyov","id":2168518,"avatar_url":"https://avatars.githubusercontent.com/u/2168518?v=3","gravatar_id":"","url":"https://api.github.com/users/YurySolovyov","html_url":"https://github.com/YurySolovyov","followers_url":"https://api.github.com/users/YurySolovyov/followers","following_url":"https://api.github.com/users/YurySolovyov/following{/other_user}","gists_url":"https://api.github.com/users/YurySolovyov/gists{/gist_id}","starred_url":"https://api.github.com/users/YurySolovyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YurySolovyov/subscriptions","organizations_url":"https://api.github.com/users/YurySolovyov/orgs","repos_url":"https://api.github.com/users/YurySolovyov/repos","events_url":"https://api.github.com/users/YurySolovyov/events{/privacy}","received_events_url":"https://api.github.com/users/YurySolovyov/received_events","type":"User","site_admin":false},"body":"API is likely to change, submitting PR to get some feedback.\r\nRelated to https://github.com/sindresorhus/cpy/issues/33","created_at":"2016-07-14T11:09:47Z","updated_at":"2016-07-14T12:28:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67db4f459894eb616b97c564575c50b582ac9884","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/cp-file/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/cp-file/issues/9/comments","statuses_url":"https://api.github.com/repos/sindresorhus/cp-file/statuses/6a08f25bc384515f033fad0d2fca65ae575aeacd","head":{"label":"YurySolovyov:progress","ref":"progress","sha":"6a08f25bc384515f033fad0d2fca65ae575aeacd","user":{"login":"YurySolovyov","id":2168518,"avatar_url":"https://avatars.githubusercontent.com/u/2168518?v=3","gravatar_id":"","url":"https://api.github.com/users/YurySolovyov","html_url":"https://github.com/YurySolovyov","followers_url":"https://api.github.com/users/YurySolovyov/followers","following_url":"https://api.github.com/users/YurySolovyov/following{/other_user}","gists_url":"https://api.github.com/users/YurySolovyov/gists{/gist_id}","starred_url":"https://api.github.com/users/YurySolovyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YurySolovyov/subscriptions","organizations_url":"https://api.github.com/users/YurySolovyov/orgs","repos_url":"https://api.github.com/users/YurySolovyov/repos","events_url":"https://api.github.com/users/YurySolovyov/events{/privacy}","received_events_url":"https://api.github.com/users/YurySolovyov/received_events","type":"User","site_admin":false},"repo":{"id":63320253,"name":"cp-file","full_name":"YurySolovyov/cp-file","owner":{"login":"YurySolovyov","id":2168518,"avatar_url":"https://avatars.githubusercontent.com/u/2168518?v=3","gravatar_id":"","url":"https://api.github.com/users/YurySolovyov","html_url":"https://github.com/YurySolovyov","followers_url":"https://api.github.com/users/YurySolovyov/followers","following_url":"https://api.github.com/users/YurySolovyov/following{/other_user}","gists_url":"https://api.github.com/users/YurySolovyov/gists{/gist_id}","starred_url":"https://api.github.com/users/YurySolovyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YurySolovyov/subscriptions","organizations_url":"https://api.github.com/users/YurySolovyov/orgs","repos_url":"https://api.github.com/users/YurySolovyov/repos","events_url":"https://api.github.com/users/YurySolovyov/events{/privacy}","received_events_url":"https://api.github.com/users/YurySolovyov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YurySolovyov/cp-file","description":"Copy a file","fork":true,"url":"https://api.github.com/repos/YurySolovyov/cp-file","forks_url":"https://api.github.com/repos/YurySolovyov/cp-file/forks","keys_url":"https://api.github.com/repos/YurySolovyov/cp-file/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YurySolovyov/cp-file/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YurySolovyov/cp-file/teams","hooks_url":"https://api.github.com/repos/YurySolovyov/cp-file/hooks","issue_events_url":"https://api.github.com/repos/YurySolovyov/cp-file/issues/events{/number}","events_url":"https://api.github.com/repos/YurySolovyov/cp-file/events","assignees_url":"https://api.github.com/repos/YurySolovyov/cp-file/assignees{/user}","branches_url":"https://api.github.com/repos/YurySolovyov/cp-file/branches{/branch}","tags_url":"https://api.github.com/repos/YurySolovyov/cp-file/tags","blobs_url":"https://api.github.com/repos/YurySolovyov/cp-file/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YurySolovyov/cp-file/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YurySolovyov/cp-file/git/refs{/sha}","trees_url":"https://api.github.com/repos/YurySolovyov/cp-file/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YurySolovyov/cp-file/statuses/{sha}","languages_url":"https://api.github.com/repos/YurySolovyov/cp-file/languages","stargazers_url":"https://api.github.com/repos/YurySolovyov/cp-file/stargazers","contributors_url":"https://api.github.com/repos/YurySolovyov/cp-file/contributors","subscribers_url":"https://api.github.com/repos/YurySolovyov/cp-file/subscribers","subscription_url":"https://api.github.com/repos/YurySolovyov/cp-file/subscription","commits_url":"https://api.github.com/repos/YurySolovyov/cp-file/commits{/sha}","git_commits_url":"https://api.github.com/repos/YurySolovyov/cp-file/git/commits{/sha}","comments_url":"https://api.github.com/repos/YurySolovyov/cp-file/comments{/number}","issue_comment_url":"https://api.github.com/repos/YurySolovyov/cp-file/issues/comments{/number}","contents_url":"https://api.github.com/repos/YurySolovyov/cp-file/contents/{+path}","compare_url":"https://api.github.com/repos/YurySolovyov/cp-file/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YurySolovyov/cp-file/merges","archive_url":"https://api.github.com/repos/YurySolovyov/cp-file/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YurySolovyov/cp-file/downloads","issues_url":"https://api.github.com/repos/YurySolovyov/cp-file/issues{/number}","pulls_url":"https://api.github.com/repos/YurySolovyov/cp-file/pulls{/number}","milestones_url":"https://api.github.com/repos/YurySolovyov/cp-file/milestones{/number}","notifications_url":"https://api.github.com/repos/YurySolovyov/cp-file/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YurySolovyov/cp-file/labels{/name}","releases_url":"https://api.github.com/repos/YurySolovyov/cp-file/releases{/id}","deployments_url":"https://api.github.com/repos/YurySolovyov/cp-file/deployments","created_at":"2016-07-14T09:02:45Z","updated_at":"2016-07-14T09:02:46Z","pushed_at":"2016-07-14T11:20:22Z","git_url":"git://github.com/YurySolovyov/cp-file.git","ssh_url":"git@github.com:YurySolovyov/cp-file.git","clone_url":"https://github.com/YurySolovyov/cp-file.git","svn_url":"https://github.com/YurySolovyov/cp-file","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sindresorhus:master","ref":"master","sha":"83b0db2fa63a775f76e4320f1a111557b48b03f2","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":21312037,"name":"cp-file","full_name":"sindresorhus/cp-file","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/cp-file","description":"Copy a file","fork":false,"url":"https://api.github.com/repos/sindresorhus/cp-file","forks_url":"https://api.github.com/repos/sindresorhus/cp-file/forks","keys_url":"https://api.github.com/repos/sindresorhus/cp-file/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/cp-file/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/cp-file/teams","hooks_url":"https://api.github.com/repos/sindresorhus/cp-file/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/cp-file/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/cp-file/events","assignees_url":"https://api.github.com/repos/sindresorhus/cp-file/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/cp-file/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/cp-file/tags","blobs_url":"https://api.github.com/repos/sindresorhus/cp-file/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/cp-file/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/cp-file/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/cp-file/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/cp-file/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/cp-file/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/cp-file/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/cp-file/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/cp-file/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/cp-file/subscription","commits_url":"https://api.github.com/repos/sindresorhus/cp-file/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/cp-file/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/cp-file/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/cp-file/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/cp-file/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/cp-file/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/cp-file/merges","archive_url":"https://api.github.com/repos/sindresorhus/cp-file/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/cp-file/downloads","issues_url":"https://api.github.com/repos/sindresorhus/cp-file/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/cp-file/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/cp-file/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/cp-file/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/cp-file/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/cp-file/releases{/id}","deployments_url":"https://api.github.com/repos/sindresorhus/cp-file/deployments","created_at":"2014-06-28T22:16:19Z","updated_at":"2016-05-02T15:48:50Z","pushed_at":"2016-07-14T11:20:22Z","git_url":"git://github.com/sindresorhus/cp-file.git","ssh_url":"git@github.com:sindresorhus/cp-file.git","clone_url":"https://github.com/sindresorhus/cp-file.git","svn_url":"https://github.com/sindresorhus/cp-file","homepage":null,"size":306,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9"},"html":{"href":"https://github.com/sindresorhus/cp-file/pull/9"},"issue":{"href":"https://api.github.com/repos/sindresorhus/cp-file/issues/9"},"comments":{"href":"https://api.github.com/repos/sindresorhus/cp-file/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/cp-file/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/cp-file/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/cp-file/statuses/6a08f25bc384515f033fad0d2fca65ae575aeacd"}}}}
{"actor":{"display_login":"schnittstabil"}}