{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/find-up/pulls/comments/88798965","pull_request_review_id":9362223,"id":88798965,"diff_hunk":"@@ -31,11 +37,17 @@ module.exports.sync = (filename, opts) => {\n \tlet dir = path.resolve(opts.cwd || '');\n \tconst root = path.parse(dir).root;\n \n+\tconst filenames = [].concat(filename);\n+\n+\tconst findPathSync = files => files\n+\t\t.map(name => path.join(dir, name))\n+\t\t.find(filePath => pathExists.sync(filePath));\n+\n \t// eslint-disable-next-line no-constant-condition\n \twhile (true) {\n-\t\tconst fp = path.join(dir, filename);\n+\t\tconst fp = findPathSync(filenames);","path":"index.js","position":43,"original_position":43,"commit_id":"80ce60affe90cccd901d205ea7d5f0938e6d23f2","original_commit_id":"80ce60affe90cccd901d205ea7d5f0938e6d23f2","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},"body":"`dir` needs to be path.join'd for each iteration.","created_at":"2016-11-20T11:24:51Z","updated_at":"2016-11-20T11:25:32Z","html_url":"https://github.com/sindresorhus/find-up/pull/12#discussion_r88798965","pull_request_url":"https://api.github.com/repos/sindresorhus/find-up/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/find-up/pulls/comments/88798965"},"html":{"href":"https://github.com/sindresorhus/find-up/pull/12#discussion_r88798965"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/find-up/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/find-up/pulls/12","id":94514651,"html_url":"https://github.com/sindresorhus/find-up/pull/12","diff_url":"https://github.com/sindresorhus/find-up/pull/12.diff","patch_url":"https://github.com/sindresorhus/find-up/pull/12.patch","issue_url":"https://api.github.com/repos/sindresorhus/find-up/issues/12","number":12,"state":"open","locked":false,"title":"Support searching multiple files","user":{"login":"mathieumg","id":1624812,"avatar_url":"https://avatars.githubusercontent.com/u/1624812?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieumg","html_url":"https://github.com/mathieumg","followers_url":"https://api.github.com/users/mathieumg/followers","following_url":"https://api.github.com/users/mathieumg/following{/other_user}","gists_url":"https://api.github.com/users/mathieumg/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieumg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieumg/subscriptions","organizations_url":"https://api.github.com/users/mathieumg/orgs","repos_url":"https://api.github.com/users/mathieumg/repos","events_url":"https://api.github.com/users/mathieumg/events{/privacy}","received_events_url":"https://api.github.com/users/mathieumg/received_events","type":"User","site_admin":false},"body":"See discussion in #11.","created_at":"2016-11-20T11:18:09Z","updated_at":"2016-11-20T11:25:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c264699786bd36ab88cf5f375801bdb5b4db4712","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/find-up/pulls/12/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/find-up/pulls/12/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/find-up/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/find-up/issues/12/comments","statuses_url":"https://api.github.com/repos/sindresorhus/find-up/statuses/80ce60affe90cccd901d205ea7d5f0938e6d23f2","head":{"label":"mathieumg:search-multiple-files","ref":"search-multiple-files","sha":"80ce60affe90cccd901d205ea7d5f0938e6d23f2","user":{"login":"mathieumg","id":1624812,"avatar_url":"https://avatars.githubusercontent.com/u/1624812?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieumg","html_url":"https://github.com/mathieumg","followers_url":"https://api.github.com/users/mathieumg/followers","following_url":"https://api.github.com/users/mathieumg/following{/other_user}","gists_url":"https://api.github.com/users/mathieumg/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieumg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieumg/subscriptions","organizations_url":"https://api.github.com/users/mathieumg/orgs","repos_url":"https://api.github.com/users/mathieumg/repos","events_url":"https://api.github.com/users/mathieumg/events{/privacy}","received_events_url":"https://api.github.com/users/mathieumg/received_events","type":"User","site_admin":false},"repo":{"id":73009675,"name":"find-up","full_name":"mathieumg/find-up","owner":{"login":"mathieumg","id":1624812,"avatar_url":"https://avatars.githubusercontent.com/u/1624812?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieumg","html_url":"https://github.com/mathieumg","followers_url":"https://api.github.com/users/mathieumg/followers","following_url":"https://api.github.com/users/mathieumg/following{/other_user}","gists_url":"https://api.github.com/users/mathieumg/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieumg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieumg/subscriptions","organizations_url":"https://api.github.com/users/mathieumg/orgs","repos_url":"https://api.github.com/users/mathieumg/repos","events_url":"https://api.github.com/users/mathieumg/events{/privacy}","received_events_url":"https://api.github.com/users/mathieumg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mathieumg/find-up","description":"Find a file by walking up parent directories","fork":true,"url":"https://api.github.com/repos/mathieumg/find-up","forks_url":"https://api.github.com/repos/mathieumg/find-up/forks","keys_url":"https://api.github.com/repos/mathieumg/find-up/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathieumg/find-up/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathieumg/find-up/teams","hooks_url":"https://api.github.com/repos/mathieumg/find-up/hooks","issue_events_url":"https://api.github.com/repos/mathieumg/find-up/issues/events{/number}","events_url":"https://api.github.com/repos/mathieumg/find-up/events","assignees_url":"https://api.github.com/repos/mathieumg/find-up/assignees{/user}","branches_url":"https://api.github.com/repos/mathieumg/find-up/branches{/branch}","tags_url":"https://api.github.com/repos/mathieumg/find-up/tags","blobs_url":"https://api.github.com/repos/mathieumg/find-up/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathieumg/find-up/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathieumg/find-up/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathieumg/find-up/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathieumg/find-up/statuses/{sha}","languages_url":"https://api.github.com/repos/mathieumg/find-up/languages","stargazers_url":"https://api.github.com/repos/mathieumg/find-up/stargazers","contributors_url":"https://api.github.com/repos/mathieumg/find-up/contributors","subscribers_url":"https://api.github.com/repos/mathieumg/find-up/subscribers","subscription_url":"https://api.github.com/repos/mathieumg/find-up/subscription","commits_url":"https://api.github.com/repos/mathieumg/find-up/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathieumg/find-up/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathieumg/find-up/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathieumg/find-up/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathieumg/find-up/contents/{+path}","compare_url":"https://api.github.com/repos/mathieumg/find-up/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathieumg/find-up/merges","archive_url":"https://api.github.com/repos/mathieumg/find-up/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathieumg/find-up/downloads","issues_url":"https://api.github.com/repos/mathieumg/find-up/issues{/number}","pulls_url":"https://api.github.com/repos/mathieumg/find-up/pulls{/number}","milestones_url":"https://api.github.com/repos/mathieumg/find-up/milestones{/number}","notifications_url":"https://api.github.com/repos/mathieumg/find-up/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathieumg/find-up/labels{/name}","releases_url":"https://api.github.com/repos/mathieumg/find-up/releases{/id}","deployments_url":"https://api.github.com/repos/mathieumg/find-up/deployments","created_at":"2016-11-06T18:16:20Z","updated_at":"2016-11-06T18:16:21Z","pushed_at":"2016-11-20T11:17:12Z","git_url":"git://github.com/mathieumg/find-up.git","ssh_url":"git@github.com:mathieumg/find-up.git","clone_url":"https://github.com/mathieumg/find-up.git","svn_url":"https://github.com/mathieumg/find-up","homepage":null,"size":15,"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":"80342293c547b6982091f6ff141a76fd70317f57","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":41723004,"name":"find-up","full_name":"sindresorhus/find-up","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/find-up","description":"Find a file by walking up parent directories","fork":false,"url":"https://api.github.com/repos/sindresorhus/find-up","forks_url":"https://api.github.com/repos/sindresorhus/find-up/forks","keys_url":"https://api.github.com/repos/sindresorhus/find-up/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/find-up/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/find-up/teams","hooks_url":"https://api.github.com/repos/sindresorhus/find-up/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/find-up/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/find-up/events","assignees_url":"https://api.github.com/repos/sindresorhus/find-up/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/find-up/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/find-up/tags","blobs_url":"https://api.github.com/repos/sindresorhus/find-up/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/find-up/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/find-up/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/find-up/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/find-up/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/find-up/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/find-up/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/find-up/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/find-up/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/find-up/subscription","commits_url":"https://api.github.com/repos/sindresorhus/find-up/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/find-up/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/find-up/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/find-up/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/find-up/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/find-up/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/find-up/merges","archive_url":"https://api.github.com/repos/sindresorhus/find-up/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/find-up/downloads","issues_url":"https://api.github.com/repos/sindresorhus/find-up/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/find-up/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/find-up/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/find-up/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/find-up/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/find-up/releases{/id}","deployments_url":"https://api.github.com/repos/sindresorhus/find-up/deployments","created_at":"2015-09-01T07:12:57Z","updated_at":"2016-11-05T16:41:30Z","pushed_at":"2016-11-20T11:18:09Z","git_url":"git://github.com/sindresorhus/find-up.git","ssh_url":"git@github.com:sindresorhus/find-up.git","clone_url":"https://github.com/sindresorhus/find-up.git","svn_url":"https://github.com/sindresorhus/find-up","homepage":null,"size":16,"stargazers_count":60,"watchers_count":60,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/find-up/pulls/12"},"html":{"href":"https://github.com/sindresorhus/find-up/pull/12"},"issue":{"href":"https://api.github.com/repos/sindresorhus/find-up/issues/12"},"comments":{"href":"https://api.github.com/repos/sindresorhus/find-up/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/find-up/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/find-up/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/find-up/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/find-up/statuses/80ce60affe90cccd901d205ea7d5f0938e6d23f2"}}}}
{"actor":{"display_login":"sindresorhus"}}