{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/34472012","id":34472012,"diff_hunk":"@@ -0,0 +1,37 @@\n+﻿var Promise = require('bluebird');\n+var fs = require('fs');\n+var path = require('path');\n+var exec = require('child_process').exec;\n+\n+module.exports = function (dest, logger) {\n+  return new Promise(function (resolve, reject) {\n+    //throw an exception if package.json does not exist\n+    try {\n+      var packageFile = path.join(dest, 'package.json');\n+      fs.statSync(packageFile);\n+    } catch (e) {\n+      if (e.code !== 'ENOENT')\n+        throw e;\n+\n+      return reject(new Error('Plugin does not contain package.json file'));\n+    }\n+\n+    var cmd = (process.env.NPM) ? process.env.NPM : 'npm';\n+    cmd += ' install';\n+\n+    var child = exec(cmd, { cwd: dest });\n+    child.on('error', function (err) {\n+      reject(err);\n+    });\n+    child.on('exit', function (code, signal) {\n+      if (code === 0) {\n+        resolve();\n+      } else {\n+        reject(new Error('npm install failed.'));","path":"src/server/bin/plugin/npmInstall.js","position":30,"original_position":30,"commit_id":"6a5978145db8e2d6eb760d24af78c4dd622f87f8","original_commit_id":"6a5978145db8e2d6eb760d24af78c4dd622f87f8","user":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"body":"It should already be respecting the silent option. The stdout and stserr streams are passed to the logger. The logger then checks the silent option to determine whether the output should be piped. Any errors ignore the silent option.","created_at":"2015-07-13T15:02:35Z","updated_at":"2015-07-13T15:02:35Z","html_url":"https://github.com/elastic/kibana/pull/4406#discussion_r34472012","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/4406","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/34472012"},"html":{"href":"https://github.com/elastic/kibana/pull/4406#discussion_r34472012"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/4406"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/4406","id":39590122,"html_url":"https://github.com/elastic/kibana/pull/4406","diff_url":"https://github.com/elastic/kibana/pull/4406.diff","patch_url":"https://github.com/elastic/kibana/pull/4406.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/4406","number":4406,"state":"open","locked":false,"title":"Install plugin","user":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"body":"Addresses #4204\r\nCreates the Kibana plugin install cli.\r\n\r\n- Removes the startup specific logic from the kibana.js file.\r\n- Moves the commander configuration for the default command into its own file\r\n- Moves the actual startup logic into its own file\r\n- Adds the plugin subcommand and all related logic\r\n- Adds unit test coverage for the majority of the new plugin subcommand logic\r\n\r\nTo use:\r\nfrom the src/server/bin folder, type:\r\n```\r\nnode kibana plugin -h\r\n```","created_at":"2015-07-09T14:39:27Z","updated_at":"2015-07-13T15:02:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cc83ada64a944c9455efc890e8df70330d86d61","assignee":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/4406/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/4406/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/4406/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/6a5978145db8e2d6eb760d24af78c4dd622f87f8","head":{"label":"BigFunger:install-plugin","ref":"install-plugin","sha":"6a5978145db8e2d6eb760d24af78c4dd622f87f8","user":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"repo":{"id":35180828,"name":"kibana","full_name":"BigFunger/kibana","owner":{"login":"BigFunger","id":12193008,"avatar_url":"https://avatars.githubusercontent.com/u/12193008?v=3","gravatar_id":"","url":"https://api.github.com/users/BigFunger","html_url":"https://github.com/BigFunger","followers_url":"https://api.github.com/users/BigFunger/followers","following_url":"https://api.github.com/users/BigFunger/following{/other_user}","gists_url":"https://api.github.com/users/BigFunger/gists{/gist_id}","starred_url":"https://api.github.com/users/BigFunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigFunger/subscriptions","organizations_url":"https://api.github.com/users/BigFunger/orgs","repos_url":"https://api.github.com/users/BigFunger/repos","events_url":"https://api.github.com/users/BigFunger/events{/privacy}","received_events_url":"https://api.github.com/users/BigFunger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BigFunger/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/BigFunger/kibana","forks_url":"https://api.github.com/repos/BigFunger/kibana/forks","keys_url":"https://api.github.com/repos/BigFunger/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BigFunger/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BigFunger/kibana/teams","hooks_url":"https://api.github.com/repos/BigFunger/kibana/hooks","issue_events_url":"https://api.github.com/repos/BigFunger/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/BigFunger/kibana/events","assignees_url":"https://api.github.com/repos/BigFunger/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/BigFunger/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/BigFunger/kibana/tags","blobs_url":"https://api.github.com/repos/BigFunger/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BigFunger/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BigFunger/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/BigFunger/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BigFunger/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/BigFunger/kibana/languages","stargazers_url":"https://api.github.com/repos/BigFunger/kibana/stargazers","contributors_url":"https://api.github.com/repos/BigFunger/kibana/contributors","subscribers_url":"https://api.github.com/repos/BigFunger/kibana/subscribers","subscription_url":"https://api.github.com/repos/BigFunger/kibana/subscription","commits_url":"https://api.github.com/repos/BigFunger/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/BigFunger/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/BigFunger/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/BigFunger/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/BigFunger/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/BigFunger/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BigFunger/kibana/merges","archive_url":"https://api.github.com/repos/BigFunger/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BigFunger/kibana/downloads","issues_url":"https://api.github.com/repos/BigFunger/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/BigFunger/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/BigFunger/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/BigFunger/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BigFunger/kibana/labels{/name}","releases_url":"https://api.github.com/repos/BigFunger/kibana/releases{/id}","created_at":"2015-05-06T20:19:18Z","updated_at":"2015-06-03T17:01:46Z","pushed_at":"2015-07-10T18:16:07Z","git_url":"git://github.com/BigFunger/kibana.git","ssh_url":"git@github.com:BigFunger/kibana.git","clone_url":"https://github.com/BigFunger/kibana.git","svn_url":"https://github.com/BigFunger/kibana","homepage":"https://www.elastic.co/products/kibana","size":57029,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"9449f185526eefec92a60c73d2ba37c412eb43bd","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":"Kibana","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","created_at":"2013-01-26T04:00:59Z","updated_at":"2015-07-13T05:45:02Z","pushed_at":"2015-07-11T00:19:24Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":94141,"stargazers_count":3813,"watchers_count":3813,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1410,"mirror_url":null,"open_issues_count":574,"forks":1410,"open_issues":574,"watchers":3813,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/4406"},"html":{"href":"https://github.com/elastic/kibana/pull/4406"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/4406"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/4406/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/4406/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/4406/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/6a5978145db8e2d6eb760d24af78c4dd622f87f8"}}}}