{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments/62243424","id":62243424,"diff_hunk":"@@ -0,0 +1,69 @@\n+'use strict'\n+\n+const Command = require('ronin').Command\n+const debug = require('debug')\n+const utils = require('../../utils')\n+const log = debug('cli:files')\n+log.error = debug('cli:files:error')\n+var fs = require('fs')\n+const pathj = require('path')\n+\n+module.exports = Command.extend({\n+  desc: 'Download IPFS objects',\n+\n+  options: {},\n+\n+  run: (path, options) => {\n+    let dir\n+    let filepath\n+    let ws\n+\n+    if (!path) {\n+      throw new Error(\"Argument 'path' is required\")\n+    }\n+    if (!options) {\n+      options = {}\n+      dir = process.cwd()\n+    } else {\n+      if (options.slice(-1) !== '/') {\n+        options += '/'\n+      }\n+      dir = options\n+    }\n+\n+    utils.getIPFS((err, ipfs) => {\n+      if (err) {\n+        throw err\n+      }\n+      ipfs.files.get(path, (err, data) => {\n+        if (err) {\n+          throw err\n+        }\n+        data.on('file', (data) => {\n+          if (data.path.lastIndexOf('/') === -1) {\n+            filepath = data.path\n+            if (data.dir === false) {\n+              ws = fs.createWriteStream(pathj.join(dir, data.path))","path":"src/cli/commands/files/get.js","position":46,"original_position":46,"commit_id":"3affbc8ac6e4827451d07bdee0bbb161bf32273a","original_commit_id":"3affbc8ac6e4827451d07bdee0bbb161bf32273a","user":{"login":"nginnever","id":7103153,"avatar_url":"https://avatars.githubusercontent.com/u/7103153?v=3","gravatar_id":"","url":"https://api.github.com/users/nginnever","html_url":"https://github.com/nginnever","followers_url":"https://api.github.com/users/nginnever/followers","following_url":"https://api.github.com/users/nginnever/following{/other_user}","gists_url":"https://api.github.com/users/nginnever/gists{/gist_id}","starred_url":"https://api.github.com/users/nginnever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nginnever/subscriptions","organizations_url":"https://api.github.com/users/nginnever/orgs","repos_url":"https://api.github.com/users/nginnever/repos","events_url":"https://api.github.com/users/nginnever/events{/privacy}","received_events_url":"https://api.github.com/users/nginnever/received_events","type":"User","site_admin":false},"body":"  60:13  error  'ws' used outside of binding context        block-scoped-var\r\n  61:30  error  'ws' used outside of binding context        block-scoped-var\r\n","created_at":"2016-05-05T19:46:59Z","updated_at":"2016-05-05T19:46:59Z","html_url":"https://github.com/ipfs/js-ipfs/pull/193#discussion_r62243424","pull_request_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193","_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments/62243424"},"html":{"href":"https://github.com/ipfs/js-ipfs/pull/193#discussion_r62243424"},"pull_request":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193"}}},"pull_request":{"url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193","id":69038682,"html_url":"https://github.com/ipfs/js-ipfs/pull/193","diff_url":"https://github.com/ipfs/js-ipfs/pull/193.diff","patch_url":"https://github.com/ipfs/js-ipfs/pull/193.patch","issue_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/193","number":193,"state":"open","locked":false,"title":"files add, cat, get core + cli offline","user":{"login":"nginnever","id":7103153,"avatar_url":"https://avatars.githubusercontent.com/u/7103153?v=3","gravatar_id":"","url":"https://api.github.com/users/nginnever","html_url":"https://github.com/nginnever","followers_url":"https://api.github.com/users/nginnever/followers","following_url":"https://api.github.com/users/nginnever/following{/other_user}","gists_url":"https://api.github.com/users/nginnever/gists{/gist_id}","starred_url":"https://api.github.com/users/nginnever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nginnever/subscriptions","organizations_url":"https://api.github.com/users/nginnever/orgs","repos_url":"https://api.github.com/users/nginnever/repos","events_url":"https://api.github.com/users/nginnever/events{/privacy}","received_events_url":"https://api.github.com/users/nginnever/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-05T17:20:43Z","updated_at":"2016-05-05T19:46:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb5ccf737000969c09f260154a668301091f746f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193/commits","review_comments_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193/comments","review_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/193/comments","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/3affbc8ac6e4827451d07bdee0bbb161bf32273a","head":{"label":"ipfs:files-core","ref":"files-core","sha":"3affbc8ac6e4827451d07bdee0bbb161bf32273a","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":20312497,"name":"js-ipfs","full_name":"ipfs/js-ipfs","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs","description":"IPFS implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs","forks_url":"https://api.github.com/repos/ipfs/js-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs/deployments","created_at":"2014-05-30T00:31:06Z","updated_at":"2016-05-03T18:12:34Z","pushed_at":"2016-05-05T17:20:43Z","git_url":"git://github.com/ipfs/js-ipfs.git","ssh_url":"git@github.com:ipfs/js-ipfs.git","clone_url":"https://github.com/ipfs/js-ipfs.git","svn_url":"https://github.com/ipfs/js-ipfs","homepage":"http://ipfs.io/","size":2163,"stargazers_count":414,"watchers_count":414,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":20,"forks":51,"open_issues":20,"watchers":414,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"506cbf15095bf56d4d79a0c386b8353b717c3733","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":20312497,"name":"js-ipfs","full_name":"ipfs/js-ipfs","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs","description":"IPFS implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs","forks_url":"https://api.github.com/repos/ipfs/js-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs/deployments","created_at":"2014-05-30T00:31:06Z","updated_at":"2016-05-03T18:12:34Z","pushed_at":"2016-05-05T17:20:43Z","git_url":"git://github.com/ipfs/js-ipfs.git","ssh_url":"git@github.com:ipfs/js-ipfs.git","clone_url":"https://github.com/ipfs/js-ipfs.git","svn_url":"https://github.com/ipfs/js-ipfs","homepage":"http://ipfs.io/","size":2163,"stargazers_count":414,"watchers_count":414,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":20,"forks":51,"open_issues":20,"watchers":414,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193"},"html":{"href":"https://github.com/ipfs/js-ipfs/pull/193"},"issue":{"href":"https://api.github.com/repos/ipfs/js-ipfs/issues/193"},"comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs/issues/193/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/193/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/js-ipfs/statuses/3affbc8ac6e4827451d07bdee0bbb161bf32273a"}}}}