{"action":"created","comment":{"url":"https://api.github.com/repos/zeit/hyperterm/pulls/comments/71971742","id":71971742,"diff_hunk":"@@ -282,48 +284,44 @@ exports.onWindow = function (win) {\n   });\n };\n \n-exports.decorateMenu = function (tpl) {\n-  let decorated = tpl;\n+// decorates the base object by calling plugin[key]\n+// for all the available plugins\n+function decorateObject (base, key) {\n+  let decorated = base;\n   modules.forEach((plugin) => {\n-    if (plugin.decorateMenu) {\n-      const res = plugin.decorateMenu(decorated);\n-      if (res) {\n+    if (plugin[key]) {\n+      const res = plugin[key](decorated);\n+      if (res && 'object' === typeof res) {\n         decorated = res;\n       } else {\n-        console.error('incompatible response type for `decorateMenu`');\n+        notify('Plugin error!', `\"${plugin._name}\": invalid return type for \\`${key}\\``);\n       }\n     }\n   });\n+\n   return decorated;\n+}\n+\n+exports.decorateMenu = function (tpl) {\n+  return decorateObject(tpl, 'decorateMenu');\n };\n \n-exports.getDecoratedConfig = function () {\n-  let decorated = config.getConfig();\n-  modules.forEach((plugin) => {\n-    if (plugin.decorateConfig) {\n-      const res = plugin.decorateConfig(decorated);\n-      if (res && 'object' === typeof res) {\n-        decorated = res;\n-      } else {\n-        notify('Plugin error!', `\"${plugin._name}\": invalid return type for \\`decorateConfig\\``);\n-      }\n-    }\n+exports.getDecoratedEnv = function () {\n+  const baseEnv = Object.assign({}, process.env, {\n+    LANG: app.getLocale(),","path":"plugins.js","position":null,"original_position":84,"commit_id":"08f24ad750c27fb2a38657d052635462bbc83ee7","original_commit_id":"c7da51eb3fc68d7f9460ec5ef9148b77474e5ce1","user":{"login":"ekmartin","id":3536982,"avatar_url":"https://avatars.githubusercontent.com/u/3536982?v=3","gravatar_id":"","url":"https://api.github.com/users/ekmartin","html_url":"https://github.com/ekmartin","followers_url":"https://api.github.com/users/ekmartin/followers","following_url":"https://api.github.com/users/ekmartin/following{/other_user}","gists_url":"https://api.github.com/users/ekmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/ekmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekmartin/subscriptions","organizations_url":"https://api.github.com/users/ekmartin/orgs","repos_url":"https://api.github.com/users/ekmartin/repos","events_url":"https://api.github.com/users/ekmartin/events{/privacy}","received_events_url":"https://api.github.com/users/ekmartin/received_events","type":"User","site_admin":false},"body":"Good feedback, fixed in 160e759ba290318c80236182423b883b0186fa9c 👍 ","created_at":"2016-07-23T12:21:51Z","updated_at":"2016-07-23T12:21:51Z","html_url":"https://github.com/zeit/hyperterm/pull/370#discussion_r71971742","pull_request_url":"https://api.github.com/repos/zeit/hyperterm/pulls/370","_links":{"self":{"href":"https://api.github.com/repos/zeit/hyperterm/pulls/comments/71971742"},"html":{"href":"https://github.com/zeit/hyperterm/pull/370#discussion_r71971742"},"pull_request":{"href":"https://api.github.com/repos/zeit/hyperterm/pulls/370"}}},"pull_request":{"url":"https://api.github.com/repos/zeit/hyperterm/pulls/370","id":78548596,"html_url":"https://github.com/zeit/hyperterm/pull/370","diff_url":"https://github.com/zeit/hyperterm/pull/370.diff","patch_url":"https://github.com/zeit/hyperterm/pull/370.patch","issue_url":"https://api.github.com/repos/zeit/hyperterm/issues/370","number":370,"state":"open","locked":false,"title":"Add decorateEnv to the extensions API","user":{"login":"ekmartin","id":3536982,"avatar_url":"https://avatars.githubusercontent.com/u/3536982?v=3","gravatar_id":"","url":"https://api.github.com/users/ekmartin","html_url":"https://github.com/ekmartin","followers_url":"https://api.github.com/users/ekmartin/followers","following_url":"https://api.github.com/users/ekmartin/following{/other_user}","gists_url":"https://api.github.com/users/ekmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/ekmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekmartin/subscriptions","organizations_url":"https://api.github.com/users/ekmartin/orgs","repos_url":"https://api.github.com/users/ekmartin/repos","events_url":"https://api.github.com/users/ekmartin/events{/privacy}","received_events_url":"https://api.github.com/users/ekmartin/received_events","type":"User","site_admin":false},"body":"See #355. This opens for plugins like this:\r\n```js\r\nexports.decorateEnv = env => (\r\n  Object.assign({}, env, {\r\n    COOL_VARIABLE: 'pretty cool'\r\n  })\r\n);\r\n```\r\n\r\n@rauchg: If this is what you had in mind I can send a PR to hyperterm-website as well, updating the extensions API list.","created_at":"2016-07-22T22:24:15Z","updated_at":"2016-07-23T12:21:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d765c5a0394fe42d12ea1ed3a2c30fd64c3da92f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zeit/hyperterm/pulls/370/commits","review_comments_url":"https://api.github.com/repos/zeit/hyperterm/pulls/370/comments","review_comment_url":"https://api.github.com/repos/zeit/hyperterm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zeit/hyperterm/issues/370/comments","statuses_url":"https://api.github.com/repos/zeit/hyperterm/statuses/08f24ad750c27fb2a38657d052635462bbc83ee7","head":{"label":"ekmartin:decorateEnv","ref":"decorateEnv","sha":"08f24ad750c27fb2a38657d052635462bbc83ee7","user":{"login":"ekmartin","id":3536982,"avatar_url":"https://avatars.githubusercontent.com/u/3536982?v=3","gravatar_id":"","url":"https://api.github.com/users/ekmartin","html_url":"https://github.com/ekmartin","followers_url":"https://api.github.com/users/ekmartin/followers","following_url":"https://api.github.com/users/ekmartin/following{/other_user}","gists_url":"https://api.github.com/users/ekmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/ekmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekmartin/subscriptions","organizations_url":"https://api.github.com/users/ekmartin/orgs","repos_url":"https://api.github.com/users/ekmartin/repos","events_url":"https://api.github.com/users/ekmartin/events{/privacy}","received_events_url":"https://api.github.com/users/ekmartin/received_events","type":"User","site_admin":false},"repo":{"id":63637209,"name":"hyperterm","full_name":"ekmartin/hyperterm","owner":{"login":"ekmartin","id":3536982,"avatar_url":"https://avatars.githubusercontent.com/u/3536982?v=3","gravatar_id":"","url":"https://api.github.com/users/ekmartin","html_url":"https://github.com/ekmartin","followers_url":"https://api.github.com/users/ekmartin/followers","following_url":"https://api.github.com/users/ekmartin/following{/other_user}","gists_url":"https://api.github.com/users/ekmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/ekmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekmartin/subscriptions","organizations_url":"https://api.github.com/users/ekmartin/orgs","repos_url":"https://api.github.com/users/ekmartin/repos","events_url":"https://api.github.com/users/ekmartin/events{/privacy}","received_events_url":"https://api.github.com/users/ekmartin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ekmartin/hyperterm","description":null,"fork":true,"url":"https://api.github.com/repos/ekmartin/hyperterm","forks_url":"https://api.github.com/repos/ekmartin/hyperterm/forks","keys_url":"https://api.github.com/repos/ekmartin/hyperterm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ekmartin/hyperterm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ekmartin/hyperterm/teams","hooks_url":"https://api.github.com/repos/ekmartin/hyperterm/hooks","issue_events_url":"https://api.github.com/repos/ekmartin/hyperterm/issues/events{/number}","events_url":"https://api.github.com/repos/ekmartin/hyperterm/events","assignees_url":"https://api.github.com/repos/ekmartin/hyperterm/assignees{/user}","branches_url":"https://api.github.com/repos/ekmartin/hyperterm/branches{/branch}","tags_url":"https://api.github.com/repos/ekmartin/hyperterm/tags","blobs_url":"https://api.github.com/repos/ekmartin/hyperterm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ekmartin/hyperterm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ekmartin/hyperterm/git/refs{/sha}","trees_url":"https://api.github.com/repos/ekmartin/hyperterm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ekmartin/hyperterm/statuses/{sha}","languages_url":"https://api.github.com/repos/ekmartin/hyperterm/languages","stargazers_url":"https://api.github.com/repos/ekmartin/hyperterm/stargazers","contributors_url":"https://api.github.com/repos/ekmartin/hyperterm/contributors","subscribers_url":"https://api.github.com/repos/ekmartin/hyperterm/subscribers","subscription_url":"https://api.github.com/repos/ekmartin/hyperterm/subscription","commits_url":"https://api.github.com/repos/ekmartin/hyperterm/commits{/sha}","git_commits_url":"https://api.github.com/repos/ekmartin/hyperterm/git/commits{/sha}","comments_url":"https://api.github.com/repos/ekmartin/hyperterm/comments{/number}","issue_comment_url":"https://api.github.com/repos/ekmartin/hyperterm/issues/comments{/number}","contents_url":"https://api.github.com/repos/ekmartin/hyperterm/contents/{+path}","compare_url":"https://api.github.com/repos/ekmartin/hyperterm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ekmartin/hyperterm/merges","archive_url":"https://api.github.com/repos/ekmartin/hyperterm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ekmartin/hyperterm/downloads","issues_url":"https://api.github.com/repos/ekmartin/hyperterm/issues{/number}","pulls_url":"https://api.github.com/repos/ekmartin/hyperterm/pulls{/number}","milestones_url":"https://api.github.com/repos/ekmartin/hyperterm/milestones{/number}","notifications_url":"https://api.github.com/repos/ekmartin/hyperterm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ekmartin/hyperterm/labels{/name}","releases_url":"https://api.github.com/repos/ekmartin/hyperterm/releases{/id}","deployments_url":"https://api.github.com/repos/ekmartin/hyperterm/deployments","created_at":"2016-07-18T21:10:59Z","updated_at":"2016-07-18T21:11:00Z","pushed_at":"2016-07-23T12:21:13Z","git_url":"git://github.com/ekmartin/hyperterm.git","ssh_url":"git@github.com:ekmartin/hyperterm.git","clone_url":"https://github.com/ekmartin/hyperterm.git","svn_url":"https://github.com/ekmartin/hyperterm","homepage":null,"size":1082,"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":"zeit:master","ref":"master","sha":"6e79beafd4854e7401a83ee77758f25c50e58b9a","user":{"login":"zeit","id":14985020,"avatar_url":"https://avatars.githubusercontent.com/u/14985020?v=3","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"repo":{"id":62367558,"name":"hyperterm","full_name":"zeit/hyperterm","owner":{"login":"zeit","id":14985020,"avatar_url":"https://avatars.githubusercontent.com/u/14985020?v=3","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zeit/hyperterm","description":null,"fork":false,"url":"https://api.github.com/repos/zeit/hyperterm","forks_url":"https://api.github.com/repos/zeit/hyperterm/forks","keys_url":"https://api.github.com/repos/zeit/hyperterm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeit/hyperterm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeit/hyperterm/teams","hooks_url":"https://api.github.com/repos/zeit/hyperterm/hooks","issue_events_url":"https://api.github.com/repos/zeit/hyperterm/issues/events{/number}","events_url":"https://api.github.com/repos/zeit/hyperterm/events","assignees_url":"https://api.github.com/repos/zeit/hyperterm/assignees{/user}","branches_url":"https://api.github.com/repos/zeit/hyperterm/branches{/branch}","tags_url":"https://api.github.com/repos/zeit/hyperterm/tags","blobs_url":"https://api.github.com/repos/zeit/hyperterm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeit/hyperterm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeit/hyperterm/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeit/hyperterm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeit/hyperterm/statuses/{sha}","languages_url":"https://api.github.com/repos/zeit/hyperterm/languages","stargazers_url":"https://api.github.com/repos/zeit/hyperterm/stargazers","contributors_url":"https://api.github.com/repos/zeit/hyperterm/contributors","subscribers_url":"https://api.github.com/repos/zeit/hyperterm/subscribers","subscription_url":"https://api.github.com/repos/zeit/hyperterm/subscription","commits_url":"https://api.github.com/repos/zeit/hyperterm/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeit/hyperterm/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeit/hyperterm/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeit/hyperterm/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeit/hyperterm/contents/{+path}","compare_url":"https://api.github.com/repos/zeit/hyperterm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeit/hyperterm/merges","archive_url":"https://api.github.com/repos/zeit/hyperterm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeit/hyperterm/downloads","issues_url":"https://api.github.com/repos/zeit/hyperterm/issues{/number}","pulls_url":"https://api.github.com/repos/zeit/hyperterm/pulls{/number}","milestones_url":"https://api.github.com/repos/zeit/hyperterm/milestones{/number}","notifications_url":"https://api.github.com/repos/zeit/hyperterm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeit/hyperterm/labels{/name}","releases_url":"https://api.github.com/repos/zeit/hyperterm/releases{/id}","deployments_url":"https://api.github.com/repos/zeit/hyperterm/deployments","created_at":"2016-07-01T06:01:21Z","updated_at":"2016-07-23T12:11:48Z","pushed_at":"2016-07-23T12:21:13Z","git_url":"git://github.com/zeit/hyperterm.git","ssh_url":"git@github.com:zeit/hyperterm.git","clone_url":"https://github.com/zeit/hyperterm.git","svn_url":"https://github.com/zeit/hyperterm","homepage":null,"size":1375,"stargazers_count":6100,"watchers_count":6100,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":251,"mirror_url":null,"open_issues_count":195,"forks":251,"open_issues":195,"watchers":6100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zeit/hyperterm/pulls/370"},"html":{"href":"https://github.com/zeit/hyperterm/pull/370"},"issue":{"href":"https://api.github.com/repos/zeit/hyperterm/issues/370"},"comments":{"href":"https://api.github.com/repos/zeit/hyperterm/issues/370/comments"},"review_comments":{"href":"https://api.github.com/repos/zeit/hyperterm/pulls/370/comments"},"review_comment":{"href":"https://api.github.com/repos/zeit/hyperterm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zeit/hyperterm/pulls/370/commits"},"statuses":{"href":"https://api.github.com/repos/zeit/hyperterm/statuses/08f24ad750c27fb2a38657d052635462bbc83ee7"}}}}
{"actor":{"display_login":"ekmartin"}}