{"action":"created","comment":{"url":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/comments/25719525","id":25719525,"diff_hunk":"@@ -68,29 +84,27 @@ module.exports =\n         atom.notifications.addError \"sync-settings: Error retrieving your settings. (\"+message+\")\"\n         return\n \n-      settings = JSON.parse(res.files[\"settings.json\"].content)\n-      console.debug \"settings: \", settings\n-      @applySettings \"\", settings\n+      for own file, filename of res.files\n+        switch filename\n+          when 'settings.json'\n+            @applySettings '', JSON.parse(file.content)\n+\n+          when 'packages.json'\n+            @installMissintPackages JSON.parse(file.content), cb\n \n-      packages = JSON.parse(res.files[\"packages.json\"].content)\n-      console.debug \"packages: \", packages\n-      @installMissingPackages packages, cb\n+          when 'keymap.cson'\n+            fs.writeFileSync atom.keymap.getUserKeymapPath(), file.content\n \n-      keymap = res.files['keymap.cson']?.content\n-      console.debug \"keymap.cson = \", res.files['keymap.cson']?.content\n-      fs.writeFileSync(atom.keymap.getUserKeymapPath(), res.files['keymap.cson'].content) if keymap\n+          when 'styles.less'\n+            fs.writeFileSync atom.themes.getUserStyleSheetPath(), file.content\n \n-      styles = res.files['styles.less']?.content\n-      console.debug \"styles.less = \", res.files['styles.less']?.content\n-      fs.writeFileSync(atom.themes.getUserStylesheetPath(), res.files['styles.less'].content) if styles\n+          when 'init.coffee'\n+            fs.writeFileSync atom.config.configDirPath + \"/init.coffee\", file.content\n \n-      initCoffee = res.files['init.coffee']?.content\n-      console.debug \"init.coffee = \", initCoffee\n-      fs.writeFileSync(atom.config.configDirPath + \"/init.coffee\", initCoffee) if initCoffee\n+          when 'snippets.cson'\n+            fs.writeFileSync atom.config.configDirPath + \"/snippets.coffee\", file.content\n \n-      snippetsCson = res.files['snippets.cson']?.content\n-      console.debug \"snippets.cson = \", snippetsCson\n-      fs.writeFileSync(atom.config.configDirPath + \"/snippets.cson\", snippetsCson) if snippetsCson\n+          else fs.writeFileSync \"#{atom.config.configDirPath}/#{filename}\"","path":"lib/sync-settings.coffee","position":78,"original_position":78,"commit_id":"9530359f6c7bad27224596a55d37570d6b81b40f","original_commit_id":"9530359f6c7bad27224596a55d37570d6b81b40f","user":{"login":"olmokramer","id":3612514,"avatar_url":"https://avatars.githubusercontent.com/u/3612514?v=3","gravatar_id":"","url":"https://api.github.com/users/olmokramer","html_url":"https://github.com/olmokramer","followers_url":"https://api.github.com/users/olmokramer/followers","following_url":"https://api.github.com/users/olmokramer/following{/other_user}","gists_url":"https://api.github.com/users/olmokramer/gists{/gist_id}","starred_url":"https://api.github.com/users/olmokramer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olmokramer/subscriptions","organizations_url":"https://api.github.com/users/olmokramer/orgs","repos_url":"https://api.github.com/users/olmokramer/repos","events_url":"https://api.github.com/users/olmokramer/events{/privacy}","received_events_url":"https://api.github.com/users/olmokramer/received_events","type":"User","site_admin":false},"body":"I didn't perform that check because the `extraFiles` config would be empty on a new install of Atom","created_at":"2015-03-03T19:46:25Z","updated_at":"2015-03-03T19:46:25Z","html_url":"https://github.com/Hackafe/atom-sync-settings/pull/32#discussion_r25719525","pull_request_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/comments/25719525"},"html":{"href":"https://github.com/Hackafe/atom-sync-settings/pull/32#discussion_r25719525"},"pull_request":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32","id":30396524,"html_url":"https://github.com/Hackafe/atom-sync-settings/pull/32","diff_url":"https://github.com/Hackafe/atom-sync-settings/pull/32.diff","patch_url":"https://github.com/Hackafe/atom-sync-settings/pull/32.patch","issue_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/issues/32","number":32,"state":"open","locked":false,"title":"Add setting to also upload files other than Atom's default files","user":{"login":"olmokramer","id":3612514,"avatar_url":"https://avatars.githubusercontent.com/u/3612514?v=3","gravatar_id":"","url":"https://api.github.com/users/olmokramer","html_url":"https://github.com/olmokramer","followers_url":"https://api.github.com/users/olmokramer/followers","following_url":"https://api.github.com/users/olmokramer/following{/other_user}","gists_url":"https://api.github.com/users/olmokramer/gists{/gist_id}","starred_url":"https://api.github.com/users/olmokramer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olmokramer/subscriptions","organizations_url":"https://api.github.com/users/olmokramer/orgs","repos_url":"https://api.github.com/users/olmokramer/repos","events_url":"https://api.github.com/users/olmokramer/events{/privacy}","received_events_url":"https://api.github.com/users/olmokramer/received_events","type":"User","site_admin":false},"body":"Add a setting, `extraFiles`, that defines files inside the `~/.atom` directory other than Atom's default config files that should also be uploaded.\r\n\r\nAlso implements #31 ","created_at":"2015-03-03T17:54:16Z","updated_at":"2015-03-03T19:46:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7211d5d968cdc3a71738c6a1ff7ebc0c53d388a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32/commits","review_comments_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32/comments","review_comment_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/issues/32/comments","statuses_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/statuses/9530359f6c7bad27224596a55d37570d6b81b40f","head":{"label":"olmokramer:extra-files","ref":"extra-files","sha":"9530359f6c7bad27224596a55d37570d6b81b40f","user":{"login":"olmokramer","id":3612514,"avatar_url":"https://avatars.githubusercontent.com/u/3612514?v=3","gravatar_id":"","url":"https://api.github.com/users/olmokramer","html_url":"https://github.com/olmokramer","followers_url":"https://api.github.com/users/olmokramer/followers","following_url":"https://api.github.com/users/olmokramer/following{/other_user}","gists_url":"https://api.github.com/users/olmokramer/gists{/gist_id}","starred_url":"https://api.github.com/users/olmokramer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olmokramer/subscriptions","organizations_url":"https://api.github.com/users/olmokramer/orgs","repos_url":"https://api.github.com/users/olmokramer/repos","events_url":"https://api.github.com/users/olmokramer/events{/privacy}","received_events_url":"https://api.github.com/users/olmokramer/received_events","type":"User","site_admin":false},"repo":{"id":31608397,"name":"atom-sync-settings","full_name":"olmokramer/atom-sync-settings","owner":{"login":"olmokramer","id":3612514,"avatar_url":"https://avatars.githubusercontent.com/u/3612514?v=3","gravatar_id":"","url":"https://api.github.com/users/olmokramer","html_url":"https://github.com/olmokramer","followers_url":"https://api.github.com/users/olmokramer/followers","following_url":"https://api.github.com/users/olmokramer/following{/other_user}","gists_url":"https://api.github.com/users/olmokramer/gists{/gist_id}","starred_url":"https://api.github.com/users/olmokramer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olmokramer/subscriptions","organizations_url":"https://api.github.com/users/olmokramer/orgs","repos_url":"https://api.github.com/users/olmokramer/repos","events_url":"https://api.github.com/users/olmokramer/events{/privacy}","received_events_url":"https://api.github.com/users/olmokramer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olmokramer/atom-sync-settings","description":"Synchronize all your settings and packages across atom instances","fork":true,"url":"https://api.github.com/repos/olmokramer/atom-sync-settings","forks_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/forks","keys_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/teams","hooks_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/hooks","issue_events_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/issues/events{/number}","events_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/events","assignees_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/assignees{/user}","branches_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/branches{/branch}","tags_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/tags","blobs_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/git/refs{/sha}","trees_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/statuses/{sha}","languages_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/languages","stargazers_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/stargazers","contributors_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/contributors","subscribers_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/subscribers","subscription_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/subscription","commits_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/commits{/sha}","git_commits_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/git/commits{/sha}","comments_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/comments{/number}","issue_comment_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/issues/comments{/number}","contents_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/contents/{+path}","compare_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/merges","archive_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/downloads","issues_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/issues{/number}","pulls_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/pulls{/number}","milestones_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/milestones{/number}","notifications_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/labels{/name}","releases_url":"https://api.github.com/repos/olmokramer/atom-sync-settings/releases{/id}","created_at":"2015-03-03T16:25:48Z","updated_at":"2015-03-03T16:25:49Z","pushed_at":"2015-03-03T17:48:56Z","git_url":"git://github.com/olmokramer/atom-sync-settings.git","ssh_url":"git@github.com:olmokramer/atom-sync-settings.git","clone_url":"https://github.com/olmokramer/atom-sync-settings.git","svn_url":"https://github.com/olmokramer/atom-sync-settings","homepage":null,"size":134,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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":"Hackafe:master","ref":"master","sha":"f7ae25a64cabad4a2a8cd41e1d78d939ad3ce0a3","user":{"login":"Hackafe","id":5607437,"avatar_url":"https://avatars.githubusercontent.com/u/5607437?v=3","gravatar_id":"","url":"https://api.github.com/users/Hackafe","html_url":"https://github.com/Hackafe","followers_url":"https://api.github.com/users/Hackafe/followers","following_url":"https://api.github.com/users/Hackafe/following{/other_user}","gists_url":"https://api.github.com/users/Hackafe/gists{/gist_id}","starred_url":"https://api.github.com/users/Hackafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hackafe/subscriptions","organizations_url":"https://api.github.com/users/Hackafe/orgs","repos_url":"https://api.github.com/users/Hackafe/repos","events_url":"https://api.github.com/users/Hackafe/events{/privacy}","received_events_url":"https://api.github.com/users/Hackafe/received_events","type":"Organization","site_admin":false},"repo":{"id":21868533,"name":"atom-sync-settings","full_name":"Hackafe/atom-sync-settings","owner":{"login":"Hackafe","id":5607437,"avatar_url":"https://avatars.githubusercontent.com/u/5607437?v=3","gravatar_id":"","url":"https://api.github.com/users/Hackafe","html_url":"https://github.com/Hackafe","followers_url":"https://api.github.com/users/Hackafe/followers","following_url":"https://api.github.com/users/Hackafe/following{/other_user}","gists_url":"https://api.github.com/users/Hackafe/gists{/gist_id}","starred_url":"https://api.github.com/users/Hackafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hackafe/subscriptions","organizations_url":"https://api.github.com/users/Hackafe/orgs","repos_url":"https://api.github.com/users/Hackafe/repos","events_url":"https://api.github.com/users/Hackafe/events{/privacy}","received_events_url":"https://api.github.com/users/Hackafe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Hackafe/atom-sync-settings","description":"Synchronize all your settings and packages across atom instances","fork":false,"url":"https://api.github.com/repos/Hackafe/atom-sync-settings","forks_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/forks","keys_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/teams","hooks_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/hooks","issue_events_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/issues/events{/number}","events_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/events","assignees_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/assignees{/user}","branches_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/branches{/branch}","tags_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/tags","blobs_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/statuses/{sha}","languages_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/languages","stargazers_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/stargazers","contributors_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/contributors","subscribers_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/subscribers","subscription_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/subscription","commits_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/contents/{+path}","compare_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/merges","archive_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/downloads","issues_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/issues{/number}","pulls_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls{/number}","milestones_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/milestones{/number}","notifications_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/labels{/name}","releases_url":"https://api.github.com/repos/Hackafe/atom-sync-settings/releases{/id}","created_at":"2014-07-15T17:11:24Z","updated_at":"2015-03-03T17:55:44Z","pushed_at":"2015-03-03T17:55:43Z","git_url":"git://github.com/Hackafe/atom-sync-settings.git","ssh_url":"git@github.com:Hackafe/atom-sync-settings.git","clone_url":"https://github.com/Hackafe/atom-sync-settings.git","svn_url":"https://github.com/Hackafe/atom-sync-settings","homepage":null,"size":344,"stargazers_count":46,"watchers_count":46,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":10,"forks":14,"open_issues":10,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32"},"html":{"href":"https://github.com/Hackafe/atom-sync-settings/pull/32"},"issue":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/issues/32"},"comments":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/Hackafe/atom-sync-settings/statuses/9530359f6c7bad27224596a55d37570d6b81b40f"}}}}