{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/trash/pulls/comments/41424221","id":41424221,"diff_hunk":"@@ -25,31 +24,10 @@ if (cli.input.length === 0) {\n \tprocess.exit(1);\n }\n \n-var files = [];\n-\n-eachAsync(cli.input, function (el, i, cb) {\n-\tpathExists(el, function (err, exists) {\n-\t\tif (err) {\n-\t\t\tcb(err);\n-\t\t\treturn;\n-\t\t}\n-\n-\t\tif (exists) {\n-\t\t\tfiles.push(el);\n-\t\t}\n-\n-\t\tcb();\n-\t});\n-}, function (err) {\n-\tif (err) {\n-\t\tconsole.error(err.message);\n-\t\tprocess.exit(1);\n-\t}\n-\n-\ttrash(files, function (err) {\n-\t\tif (err) {\n-\t\t\tconsole.error(err.message);\n-\t\t\tprocess.exit(1);\n-\t\t}\n+Promise.all(cli.input.map(function (el) {\n+\treturn pify(pathExists, Promise)(el).then(function (exists) {","path":"cli.js","position":60,"original_position":60,"commit_id":"cfa0fbe0398a24d5174e44d43e0a85855916e8fc","original_commit_id":"cfa0fbe0398a24d5174e44d43e0a85855916e8fc","user":{"login":"kevva","id":709159,"avatar_url":"https://avatars.githubusercontent.com/u/709159?v=3","gravatar_id":"","url":"https://api.github.com/users/kevva","html_url":"https://github.com/kevva","followers_url":"https://api.github.com/users/kevva/followers","following_url":"https://api.github.com/users/kevva/following{/other_user}","gists_url":"https://api.github.com/users/kevva/gists{/gist_id}","starred_url":"https://api.github.com/users/kevva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevva/subscriptions","organizations_url":"https://api.github.com/users/kevva/orgs","repos_url":"https://api.github.com/users/kevva/repos","events_url":"https://api.github.com/users/kevva/events{/privacy}","received_events_url":"https://api.github.com/users/kevva/received_events","type":"User","site_admin":false},"body":"Ah, sweet. I'll bump it.","created_at":"2015-10-07T18:05:41Z","updated_at":"2015-10-07T18:05:41Z","html_url":"https://github.com/sindresorhus/trash/pull/35#discussion_r41424221","pull_request_url":"https://api.github.com/repos/sindresorhus/trash/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/trash/pulls/comments/41424221"},"html":{"href":"https://github.com/sindresorhus/trash/pull/35#discussion_r41424221"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/trash/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/trash/pulls/35","id":47059553,"html_url":"https://github.com/sindresorhus/trash/pull/35","diff_url":"https://github.com/sindresorhus/trash/pull/35.diff","patch_url":"https://github.com/sindresorhus/trash/pull/35.patch","issue_url":"https://api.github.com/repos/sindresorhus/trash/issues/35","number":35,"state":"open","locked":false,"title":"Use promises and ES2015ify tests","user":{"login":"kevva","id":709159,"avatar_url":"https://avatars.githubusercontent.com/u/709159?v=3","gravatar_id":"","url":"https://api.github.com/users/kevva","html_url":"https://github.com/kevva","followers_url":"https://api.github.com/users/kevva/followers","following_url":"https://api.github.com/users/kevva/following{/other_user}","gists_url":"https://api.github.com/users/kevva/gists{/gist_id}","starred_url":"https://api.github.com/users/kevva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevva/subscriptions","organizations_url":"https://api.github.com/users/kevva/orgs","repos_url":"https://api.github.com/users/kevva/repos","events_url":"https://api.github.com/users/kevva/events{/privacy}","received_events_url":"https://api.github.com/users/kevva/received_events","type":"User","site_admin":false},"body":"Also adds XO linting and a small Travis tweak.","created_at":"2015-10-07T17:51:14Z","updated_at":"2015-10-07T18:05:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c7f33a18895d614d895d09f2e9406d1e7047f5f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/trash/pulls/35/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/trash/pulls/35/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/trash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/trash/issues/35/comments","statuses_url":"https://api.github.com/repos/sindresorhus/trash/statuses/cfa0fbe0398a24d5174e44d43e0a85855916e8fc","head":{"label":"sindresorhus:promise","ref":"promise","sha":"cfa0fbe0398a24d5174e44d43e0a85855916e8fc","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":19789032,"name":"trash","full_name":"sindresorhus/trash","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/trash","description":"Cross-platform command-line app for moving files and directories to the trash - A safer alternative to `rm`","fork":false,"url":"https://api.github.com/repos/sindresorhus/trash","forks_url":"https://api.github.com/repos/sindresorhus/trash/forks","keys_url":"https://api.github.com/repos/sindresorhus/trash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/trash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/trash/teams","hooks_url":"https://api.github.com/repos/sindresorhus/trash/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/trash/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/trash/events","assignees_url":"https://api.github.com/repos/sindresorhus/trash/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/trash/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/trash/tags","blobs_url":"https://api.github.com/repos/sindresorhus/trash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/trash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/trash/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/trash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/trash/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/trash/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/trash/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/trash/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/trash/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/trash/subscription","commits_url":"https://api.github.com/repos/sindresorhus/trash/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/trash/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/trash/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/trash/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/trash/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/trash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/trash/merges","archive_url":"https://api.github.com/repos/sindresorhus/trash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/trash/downloads","issues_url":"https://api.github.com/repos/sindresorhus/trash/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/trash/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/trash/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/trash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/trash/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/trash/releases{/id}","created_at":"2014-05-14T17:25:32Z","updated_at":"2015-10-07T06:48:28Z","pushed_at":"2015-10-07T17:51:14Z","git_url":"git://github.com/sindresorhus/trash.git","ssh_url":"git@github.com:sindresorhus/trash.git","clone_url":"https://github.com/sindresorhus/trash.git","svn_url":"https://github.com/sindresorhus/trash","homepage":"","size":510,"stargazers_count":1005,"watchers_count":1005,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":4,"forks":12,"open_issues":4,"watchers":1005,"default_branch":"master"}},"base":{"label":"sindresorhus:master","ref":"master","sha":"1b675632274474ba8797a9c82ebb462d0c58b33e","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":19789032,"name":"trash","full_name":"sindresorhus/trash","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/trash","description":"Cross-platform command-line app for moving files and directories to the trash - A safer alternative to `rm`","fork":false,"url":"https://api.github.com/repos/sindresorhus/trash","forks_url":"https://api.github.com/repos/sindresorhus/trash/forks","keys_url":"https://api.github.com/repos/sindresorhus/trash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/trash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/trash/teams","hooks_url":"https://api.github.com/repos/sindresorhus/trash/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/trash/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/trash/events","assignees_url":"https://api.github.com/repos/sindresorhus/trash/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/trash/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/trash/tags","blobs_url":"https://api.github.com/repos/sindresorhus/trash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/trash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/trash/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/trash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/trash/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/trash/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/trash/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/trash/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/trash/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/trash/subscription","commits_url":"https://api.github.com/repos/sindresorhus/trash/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/trash/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/trash/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/trash/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/trash/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/trash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/trash/merges","archive_url":"https://api.github.com/repos/sindresorhus/trash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/trash/downloads","issues_url":"https://api.github.com/repos/sindresorhus/trash/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/trash/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/trash/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/trash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/trash/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/trash/releases{/id}","created_at":"2014-05-14T17:25:32Z","updated_at":"2015-10-07T06:48:28Z","pushed_at":"2015-10-07T17:51:14Z","git_url":"git://github.com/sindresorhus/trash.git","ssh_url":"git@github.com:sindresorhus/trash.git","clone_url":"https://github.com/sindresorhus/trash.git","svn_url":"https://github.com/sindresorhus/trash","homepage":"","size":510,"stargazers_count":1005,"watchers_count":1005,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":4,"forks":12,"open_issues":4,"watchers":1005,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/trash/pulls/35"},"html":{"href":"https://github.com/sindresorhus/trash/pull/35"},"issue":{"href":"https://api.github.com/repos/sindresorhus/trash/issues/35"},"comments":{"href":"https://api.github.com/repos/sindresorhus/trash/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/trash/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/trash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/trash/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/trash/statuses/cfa0fbe0398a24d5174e44d43e0a85855916e8fc"}}}}