{"action":"created","comment":{"url":"https://api.github.com/repos/js-cli/js-liftoff/pulls/comments/58470504","id":58470504,"diff_hunk":"@@ -0,0 +1,252 @@\n+const fs = require('fs');\n+const path = require('path');\n+const oshomedir = require('os-homedir');\n+\n+const isFunction = require('lodash.isfunction');\n+const isPlainObject = require('lodash.isplainobject');\n+const isArray = require('lodash.isarray');\n+const isString = require('lodash.isstring');\n+const doNothing = require('lodash.identity');\n+const mapValues = require('lodash.mapvalues');\n+\n+const isAbsolutePath = require('is-absolute');\n+const parsePath = require('parse-filepath');\n+\n+const isWindows = process.platform === 'win32';\n+\n+\n+function firstUnNullElem(arr, fn /*, ...*/) {\n+  var args = Array.prototype.slice.call(arguments, 2);\n+\n+  for (var i = 0, n = arr.length; i < n; i++) {\n+    var ret = fn.apply(arr, [arr[i]].concat(args));\n+    if (ret) {\n+      return ret;\n+    }\n+  }\n+  return null;\n+}\n+\n+function eachUnNullElem(arr, fn /*, ...*/) {\n+  var args = Array.prototype.slice.call(arguments, 2);\n+\n+  var ret = [];\n+  for (var i = 0, n = arr.length; i < n; i++) {\n+    var v = fn.apply(arr, [arr[i]].concat(args));\n+    if (v) {\n+      if (isArray(v)) {\n+        Array.prototype.push.apply(ret, v);\n+      } else {\n+        ret.push(v);\n+      }\n+    }\n+  }\n+  return ret;\n+}\n+\n+\n+function normalizeHomedir(pth, homedir) {\n+  if (!pth) {\n+    return pth;\n+  }\n+\n+  if (pth[0] === '~') {\n+    if (pth.length === 1) {\n+      return homedir;\n+    }\n+\n+    if (pth[1] === '/') {\n+      return path.join(homedir, pth.slice(2));\n+    }\n+\n+    if (isWindows && pth[1] === '\\\\') {\n+      return path.join(homedir, pth.slice(2));\n+    }\n+  }\n+\n+  return pth;\n+}\n+\n+function normalizePath(pth, ctx) {\n+  if (isFunction(pth)) {\n+    pth = pth();\n+  }\n+\n+  pth = normalizeHomedir(pth, ctx.homedir);\n+\n+  if (!isAbsolutePath(pth)) {\n+    return path.join(ctx.cwd, pth);\n+  }\n+\n+  return path.normalize(pth);\n+}\n+\n+\n+var initCtx = {\n+  homedir: oshomedir(),\n+  cwd: process.cwd(),\n+};\n+\n+function normalizeContext(ctx) {\n+  ctx = mapValues(ctx || {}, doNothing);\n+\n+  ctx.cwd = !ctx.cwd ? initCtx.cwd :\n+    normalizePath(ctx.cwd, initCtx);\n+\n+  ctx.homedir = !ctx.homedir ? initCtx.homedir :\n+    normalizePath(ctx.homedir, initCtx);\n+\n+  return ctx;\n+}\n+\n+function normalizeExtensions(exts) {\n+  if (isFunction(exts)) {","path":"lib/search_files.js","position":103,"original_position":103,"commit_id":"becb0f921b3a538f6530b991ca03d2eb29174678","original_commit_id":"becb0f921b3a538f6530b991ca03d2eb29174678","user":{"login":"tkellen","id":1004324,"avatar_url":"https://avatars.githubusercontent.com/u/1004324?v=3","gravatar_id":"","url":"https://api.github.com/users/tkellen","html_url":"https://github.com/tkellen","followers_url":"https://api.github.com/users/tkellen/followers","following_url":"https://api.github.com/users/tkellen/following{/other_user}","gists_url":"https://api.github.com/users/tkellen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkellen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkellen/subscriptions","organizations_url":"https://api.github.com/users/tkellen/orgs","repos_url":"https://api.github.com/users/tkellen/repos","events_url":"https://api.github.com/users/tkellen/events{/privacy}","received_events_url":"https://api.github.com/users/tkellen/received_events","type":"User","site_admin":false},"body":"Actually, this entire set of functionality should be a standalone lib that we can use for all extension files.","created_at":"2016-04-05T00:19:50Z","updated_at":"2016-04-05T00:19:50Z","html_url":"https://github.com/js-cli/js-liftoff/pull/67#discussion_r58470504","pull_request_url":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/js-cli/js-liftoff/pulls/comments/58470504"},"html":{"href":"https://github.com/js-cli/js-liftoff/pull/67#discussion_r58470504"},"pull_request":{"href":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67","id":63895117,"html_url":"https://github.com/js-cli/js-liftoff/pull/67","diff_url":"https://github.com/js-cli/js-liftoff/pull/67.diff","patch_url":"https://github.com/js-cli/js-liftoff/pull/67.patch","issue_url":"https://api.github.com/repos/js-cli/js-liftoff/issues/67","number":67,"state":"open","locked":false,"title":"Support multiple configuration files.","user":{"login":"sttk","id":8656098,"avatar_url":"https://avatars.githubusercontent.com/u/8656098?v=3","gravatar_id":"","url":"https://api.github.com/users/sttk","html_url":"https://github.com/sttk","followers_url":"https://api.github.com/users/sttk/followers","following_url":"https://api.github.com/users/sttk/following{/other_user}","gists_url":"https://api.github.com/users/sttk/gists{/gist_id}","starred_url":"https://api.github.com/users/sttk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttk/subscriptions","organizations_url":"https://api.github.com/users/sttk/orgs","repos_url":"https://api.github.com/users/sttk/repos","events_url":"https://api.github.com/users/sttk/events{/privacy}","received_events_url":"https://api.github.com/users/sttk/received_events","type":"User","site_admin":false},"body":"This is the PR about #8.\r\nPlease review.","created_at":"2016-03-23T14:56:16Z","updated_at":"2016-04-05T00:19:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a5d108df202bd8f9b621d721f68e7ad150767fa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67/commits","review_comments_url":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67/comments","review_comment_url":"https://api.github.com/repos/js-cli/js-liftoff/pulls/comments{/number}","comments_url":"https://api.github.com/repos/js-cli/js-liftoff/issues/67/comments","statuses_url":"https://api.github.com/repos/js-cli/js-liftoff/statuses/becb0f921b3a538f6530b991ca03d2eb29174678","head":{"label":"sttk:support_multiple_config_files","ref":"support_multiple_config_files","sha":"becb0f921b3a538f6530b991ca03d2eb29174678","user":{"login":"sttk","id":8656098,"avatar_url":"https://avatars.githubusercontent.com/u/8656098?v=3","gravatar_id":"","url":"https://api.github.com/users/sttk","html_url":"https://github.com/sttk","followers_url":"https://api.github.com/users/sttk/followers","following_url":"https://api.github.com/users/sttk/following{/other_user}","gists_url":"https://api.github.com/users/sttk/gists{/gist_id}","starred_url":"https://api.github.com/users/sttk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttk/subscriptions","organizations_url":"https://api.github.com/users/sttk/orgs","repos_url":"https://api.github.com/users/sttk/repos","events_url":"https://api.github.com/users/sttk/events{/privacy}","received_events_url":"https://api.github.com/users/sttk/received_events","type":"User","site_admin":false},"repo":{"id":53057876,"name":"js-liftoff","full_name":"sttk/js-liftoff","owner":{"login":"sttk","id":8656098,"avatar_url":"https://avatars.githubusercontent.com/u/8656098?v=3","gravatar_id":"","url":"https://api.github.com/users/sttk","html_url":"https://github.com/sttk","followers_url":"https://api.github.com/users/sttk/followers","following_url":"https://api.github.com/users/sttk/following{/other_user}","gists_url":"https://api.github.com/users/sttk/gists{/gist_id}","starred_url":"https://api.github.com/users/sttk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttk/subscriptions","organizations_url":"https://api.github.com/users/sttk/orgs","repos_url":"https://api.github.com/users/sttk/repos","events_url":"https://api.github.com/users/sttk/events{/privacy}","received_events_url":"https://api.github.com/users/sttk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sttk/js-liftoff","description":"Launch your command line tool with ease.","fork":true,"url":"https://api.github.com/repos/sttk/js-liftoff","forks_url":"https://api.github.com/repos/sttk/js-liftoff/forks","keys_url":"https://api.github.com/repos/sttk/js-liftoff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sttk/js-liftoff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sttk/js-liftoff/teams","hooks_url":"https://api.github.com/repos/sttk/js-liftoff/hooks","issue_events_url":"https://api.github.com/repos/sttk/js-liftoff/issues/events{/number}","events_url":"https://api.github.com/repos/sttk/js-liftoff/events","assignees_url":"https://api.github.com/repos/sttk/js-liftoff/assignees{/user}","branches_url":"https://api.github.com/repos/sttk/js-liftoff/branches{/branch}","tags_url":"https://api.github.com/repos/sttk/js-liftoff/tags","blobs_url":"https://api.github.com/repos/sttk/js-liftoff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sttk/js-liftoff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sttk/js-liftoff/git/refs{/sha}","trees_url":"https://api.github.com/repos/sttk/js-liftoff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sttk/js-liftoff/statuses/{sha}","languages_url":"https://api.github.com/repos/sttk/js-liftoff/languages","stargazers_url":"https://api.github.com/repos/sttk/js-liftoff/stargazers","contributors_url":"https://api.github.com/repos/sttk/js-liftoff/contributors","subscribers_url":"https://api.github.com/repos/sttk/js-liftoff/subscribers","subscription_url":"https://api.github.com/repos/sttk/js-liftoff/subscription","commits_url":"https://api.github.com/repos/sttk/js-liftoff/commits{/sha}","git_commits_url":"https://api.github.com/repos/sttk/js-liftoff/git/commits{/sha}","comments_url":"https://api.github.com/repos/sttk/js-liftoff/comments{/number}","issue_comment_url":"https://api.github.com/repos/sttk/js-liftoff/issues/comments{/number}","contents_url":"https://api.github.com/repos/sttk/js-liftoff/contents/{+path}","compare_url":"https://api.github.com/repos/sttk/js-liftoff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sttk/js-liftoff/merges","archive_url":"https://api.github.com/repos/sttk/js-liftoff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sttk/js-liftoff/downloads","issues_url":"https://api.github.com/repos/sttk/js-liftoff/issues{/number}","pulls_url":"https://api.github.com/repos/sttk/js-liftoff/pulls{/number}","milestones_url":"https://api.github.com/repos/sttk/js-liftoff/milestones{/number}","notifications_url":"https://api.github.com/repos/sttk/js-liftoff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sttk/js-liftoff/labels{/name}","releases_url":"https://api.github.com/repos/sttk/js-liftoff/releases{/id}","deployments_url":"https://api.github.com/repos/sttk/js-liftoff/deployments","created_at":"2016-03-03T14:46:00Z","updated_at":"2016-03-03T14:46:01Z","pushed_at":"2016-04-04T21:15:31Z","git_url":"git://github.com/sttk/js-liftoff.git","ssh_url":"git@github.com:sttk/js-liftoff.git","clone_url":"https://github.com/sttk/js-liftoff.git","svn_url":"https://github.com/sttk/js-liftoff","homepage":null,"size":693,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"js-cli:master","ref":"master","sha":"82a6911aff57aee0b1bf121015fcc492d1129238","user":{"login":"js-cli","id":14288130,"avatar_url":"https://avatars.githubusercontent.com/u/14288130?v=3","gravatar_id":"","url":"https://api.github.com/users/js-cli","html_url":"https://github.com/js-cli","followers_url":"https://api.github.com/users/js-cli/followers","following_url":"https://api.github.com/users/js-cli/following{/other_user}","gists_url":"https://api.github.com/users/js-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/js-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/js-cli/subscriptions","organizations_url":"https://api.github.com/users/js-cli/orgs","repos_url":"https://api.github.com/users/js-cli/repos","events_url":"https://api.github.com/users/js-cli/events{/privacy}","received_events_url":"https://api.github.com/users/js-cli/received_events","type":"Organization","site_admin":false},"repo":{"id":16415622,"name":"js-liftoff","full_name":"js-cli/js-liftoff","owner":{"login":"js-cli","id":14288130,"avatar_url":"https://avatars.githubusercontent.com/u/14288130?v=3","gravatar_id":"","url":"https://api.github.com/users/js-cli","html_url":"https://github.com/js-cli","followers_url":"https://api.github.com/users/js-cli/followers","following_url":"https://api.github.com/users/js-cli/following{/other_user}","gists_url":"https://api.github.com/users/js-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/js-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/js-cli/subscriptions","organizations_url":"https://api.github.com/users/js-cli/orgs","repos_url":"https://api.github.com/users/js-cli/repos","events_url":"https://api.github.com/users/js-cli/events{/privacy}","received_events_url":"https://api.github.com/users/js-cli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/js-cli/js-liftoff","description":"Launch your command line tool with ease.","fork":false,"url":"https://api.github.com/repos/js-cli/js-liftoff","forks_url":"https://api.github.com/repos/js-cli/js-liftoff/forks","keys_url":"https://api.github.com/repos/js-cli/js-liftoff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/js-cli/js-liftoff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/js-cli/js-liftoff/teams","hooks_url":"https://api.github.com/repos/js-cli/js-liftoff/hooks","issue_events_url":"https://api.github.com/repos/js-cli/js-liftoff/issues/events{/number}","events_url":"https://api.github.com/repos/js-cli/js-liftoff/events","assignees_url":"https://api.github.com/repos/js-cli/js-liftoff/assignees{/user}","branches_url":"https://api.github.com/repos/js-cli/js-liftoff/branches{/branch}","tags_url":"https://api.github.com/repos/js-cli/js-liftoff/tags","blobs_url":"https://api.github.com/repos/js-cli/js-liftoff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/js-cli/js-liftoff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/js-cli/js-liftoff/git/refs{/sha}","trees_url":"https://api.github.com/repos/js-cli/js-liftoff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/js-cli/js-liftoff/statuses/{sha}","languages_url":"https://api.github.com/repos/js-cli/js-liftoff/languages","stargazers_url":"https://api.github.com/repos/js-cli/js-liftoff/stargazers","contributors_url":"https://api.github.com/repos/js-cli/js-liftoff/contributors","subscribers_url":"https://api.github.com/repos/js-cli/js-liftoff/subscribers","subscription_url":"https://api.github.com/repos/js-cli/js-liftoff/subscription","commits_url":"https://api.github.com/repos/js-cli/js-liftoff/commits{/sha}","git_commits_url":"https://api.github.com/repos/js-cli/js-liftoff/git/commits{/sha}","comments_url":"https://api.github.com/repos/js-cli/js-liftoff/comments{/number}","issue_comment_url":"https://api.github.com/repos/js-cli/js-liftoff/issues/comments{/number}","contents_url":"https://api.github.com/repos/js-cli/js-liftoff/contents/{+path}","compare_url":"https://api.github.com/repos/js-cli/js-liftoff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/js-cli/js-liftoff/merges","archive_url":"https://api.github.com/repos/js-cli/js-liftoff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/js-cli/js-liftoff/downloads","issues_url":"https://api.github.com/repos/js-cli/js-liftoff/issues{/number}","pulls_url":"https://api.github.com/repos/js-cli/js-liftoff/pulls{/number}","milestones_url":"https://api.github.com/repos/js-cli/js-liftoff/milestones{/number}","notifications_url":"https://api.github.com/repos/js-cli/js-liftoff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/js-cli/js-liftoff/labels{/name}","releases_url":"https://api.github.com/repos/js-cli/js-liftoff/releases{/id}","deployments_url":"https://api.github.com/repos/js-cli/js-liftoff/deployments","created_at":"2014-01-31T17:53:43Z","updated_at":"2016-04-04T13:57:23Z","pushed_at":"2016-04-04T21:15:31Z","git_url":"git://github.com/js-cli/js-liftoff.git","ssh_url":"git@github.com:js-cli/js-liftoff.git","clone_url":"https://github.com/js-cli/js-liftoff.git","svn_url":"https://github.com/js-cli/js-liftoff","homepage":null,"size":690,"stargazers_count":446,"watchers_count":446,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":35,"mirror_url":null,"open_issues_count":7,"forks":35,"open_issues":7,"watchers":446,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67"},"html":{"href":"https://github.com/js-cli/js-liftoff/pull/67"},"issue":{"href":"https://api.github.com/repos/js-cli/js-liftoff/issues/67"},"comments":{"href":"https://api.github.com/repos/js-cli/js-liftoff/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/js-cli/js-liftoff/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/js-cli/js-liftoff/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/js-cli/js-liftoff/statuses/becb0f921b3a538f6530b991ca03d2eb29174678"}}}}