{"action":"created","comment":{"url":"https://api.github.com/repos/exercism/cli/pulls/comments/30812216","id":30812216,"diff_hunk":"@@ -1,23 +1,48 @@\n package cmd\n \n import (\n+\t\"encoding/json\"\n+\t\"errors\"\n \t\"fmt\"\n \t\"log\"\n \t\"net/http\"\n \t\"os\"\n \t\"runtime\"\n+\t\"strings\"\n \t\"time\"\n \n \t\"github.com/codegangsta/cli\"\n \t\"github.com/exercism/cli/config\"\n )\n \n+type release struct {\n+\tLocation string `json:\"html_url\"`\n+\tTagName  string `json:\"tag_name\"`\n+}\n+\n+func (r *release) Version() string {\n+\treturn strings.TrimPrefix(r.TagName, \"v\")\n+}\n+\n // Debug provides information about the user's environment and configuration.\n func Debug(ctx *cli.Context) {\n \tdefer fmt.Printf(\"\\nIf you are having trouble and need to file a GitHub issue (https://github.com/exercism/exercism.io/issues) please include this information (except your API key. Keep that private).\\n\")\n \n+\tclient := http.Client{Timeout: 5 * time.Second}\n+\n \tfmt.Printf(\"\\n**** Debug Information ****\\n\")\n \tfmt.Printf(\"Exercism CLI Version: %s\\n\", ctx.App.Version)\n+\n+\trel, err := checkLatestRelease(client)\n+\tif err != nil {\n+\t\tlog.Println(err)\n+\t} else {\n+\t\tif rel.Version() != ctx.App.Version {\n+\t\t\tdefer fmt.Println(\"\\nYour CLI is outdated. A new release can be found here:\", rel.Location)","path":"cmd/debug.go","position":41,"original_position":41,"commit_id":"68f437f471a03e07765e922b25f26c5566d3fc26","original_commit_id":"68f437f471a03e07765e922b25f26c5566d3fc26","user":{"login":"Tonkpils","id":1507561,"avatar_url":"https://avatars.githubusercontent.com/u/1507561?v=3","gravatar_id":"","url":"https://api.github.com/users/Tonkpils","html_url":"https://github.com/Tonkpils","followers_url":"https://api.github.com/users/Tonkpils/followers","following_url":"https://api.github.com/users/Tonkpils/following{/other_user}","gists_url":"https://api.github.com/users/Tonkpils/gists{/gist_id}","starred_url":"https://api.github.com/users/Tonkpils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tonkpils/subscriptions","organizations_url":"https://api.github.com/users/Tonkpils/orgs","repos_url":"https://api.github.com/users/Tonkpils/repos","events_url":"https://api.github.com/users/Tonkpils/events{/privacy}","received_events_url":"https://api.github.com/users/Tonkpils/received_events","type":"User","site_admin":false},"body":"Sounds good, I'll change it to the latter one! Thanks!","created_at":"2015-05-21T15:14:54Z","updated_at":"2015-05-21T15:14:54Z","html_url":"https://github.com/exercism/cli/pull/195#discussion_r30812216","pull_request_url":"https://api.github.com/repos/exercism/cli/pulls/195","_links":{"self":{"href":"https://api.github.com/repos/exercism/cli/pulls/comments/30812216"},"html":{"href":"https://github.com/exercism/cli/pull/195#discussion_r30812216"},"pull_request":{"href":"https://api.github.com/repos/exercism/cli/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/exercism/cli/pulls/195","id":35876031,"html_url":"https://github.com/exercism/cli/pull/195","diff_url":"https://github.com/exercism/cli/pull/195.diff","patch_url":"https://github.com/exercism/cli/pull/195.patch","issue_url":"https://api.github.com/repos/exercism/cli/issues/195","number":195,"state":"open","locked":false,"title":"Print release info on debug","user":{"login":"Tonkpils","id":1507561,"avatar_url":"https://avatars.githubusercontent.com/u/1507561?v=3","gravatar_id":"","url":"https://api.github.com/users/Tonkpils","html_url":"https://github.com/Tonkpils","followers_url":"https://api.github.com/users/Tonkpils/followers","following_url":"https://api.github.com/users/Tonkpils/following{/other_user}","gists_url":"https://api.github.com/users/Tonkpils/gists{/gist_id}","starred_url":"https://api.github.com/users/Tonkpils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tonkpils/subscriptions","organizations_url":"https://api.github.com/users/Tonkpils/orgs","repos_url":"https://api.github.com/users/Tonkpils/repos","events_url":"https://api.github.com/users/Tonkpils/events{/privacy}","received_events_url":"https://api.github.com/users/Tonkpils/received_events","type":"User","site_admin":false},"body":"This prints out the latest release version as part of the debug and it informs the user if their client is currently outdated and where they can find the latest release. \r\n\r\nThis is in the interim while I work on the `upgrade` functionality. \r\n\r\nThe wording could use some help though. \r\n\r\nThis is mostly for review and thoughts. If we want the upgrade functionality instead of this I'll have it ready fairly soon.","created_at":"2015-05-20T21:04:47Z","updated_at":"2015-05-21T15:14:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53f19a06c5f765d33b8720a8f17d73aee805eb28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/exercism/cli/pulls/195/commits","review_comments_url":"https://api.github.com/repos/exercism/cli/pulls/195/comments","review_comment_url":"https://api.github.com/repos/exercism/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exercism/cli/issues/195/comments","statuses_url":"https://api.github.com/repos/exercism/cli/statuses/68f437f471a03e07765e922b25f26c5566d3fc26","head":{"label":"Tonkpils:update-suggestion","ref":"update-suggestion","sha":"68f437f471a03e07765e922b25f26c5566d3fc26","user":{"login":"Tonkpils","id":1507561,"avatar_url":"https://avatars.githubusercontent.com/u/1507561?v=3","gravatar_id":"","url":"https://api.github.com/users/Tonkpils","html_url":"https://github.com/Tonkpils","followers_url":"https://api.github.com/users/Tonkpils/followers","following_url":"https://api.github.com/users/Tonkpils/following{/other_user}","gists_url":"https://api.github.com/users/Tonkpils/gists{/gist_id}","starred_url":"https://api.github.com/users/Tonkpils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tonkpils/subscriptions","organizations_url":"https://api.github.com/users/Tonkpils/orgs","repos_url":"https://api.github.com/users/Tonkpils/repos","events_url":"https://api.github.com/users/Tonkpils/events{/privacy}","received_events_url":"https://api.github.com/users/Tonkpils/received_events","type":"User","site_admin":false},"repo":{"id":13131643,"name":"cli","full_name":"Tonkpils/cli","owner":{"login":"Tonkpils","id":1507561,"avatar_url":"https://avatars.githubusercontent.com/u/1507561?v=3","gravatar_id":"","url":"https://api.github.com/users/Tonkpils","html_url":"https://github.com/Tonkpils","followers_url":"https://api.github.com/users/Tonkpils/followers","following_url":"https://api.github.com/users/Tonkpils/following{/other_user}","gists_url":"https://api.github.com/users/Tonkpils/gists{/gist_id}","starred_url":"https://api.github.com/users/Tonkpils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tonkpils/subscriptions","organizations_url":"https://api.github.com/users/Tonkpils/orgs","repos_url":"https://api.github.com/users/Tonkpils/repos","events_url":"https://api.github.com/users/Tonkpils/events{/privacy}","received_events_url":"https://api.github.com/users/Tonkpils/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tonkpils/cli","description":"A Go based command line tool for exercism.io.","fork":true,"url":"https://api.github.com/repos/Tonkpils/cli","forks_url":"https://api.github.com/repos/Tonkpils/cli/forks","keys_url":"https://api.github.com/repos/Tonkpils/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tonkpils/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tonkpils/cli/teams","hooks_url":"https://api.github.com/repos/Tonkpils/cli/hooks","issue_events_url":"https://api.github.com/repos/Tonkpils/cli/issues/events{/number}","events_url":"https://api.github.com/repos/Tonkpils/cli/events","assignees_url":"https://api.github.com/repos/Tonkpils/cli/assignees{/user}","branches_url":"https://api.github.com/repos/Tonkpils/cli/branches{/branch}","tags_url":"https://api.github.com/repos/Tonkpils/cli/tags","blobs_url":"https://api.github.com/repos/Tonkpils/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tonkpils/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tonkpils/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tonkpils/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tonkpils/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/Tonkpils/cli/languages","stargazers_url":"https://api.github.com/repos/Tonkpils/cli/stargazers","contributors_url":"https://api.github.com/repos/Tonkpils/cli/contributors","subscribers_url":"https://api.github.com/repos/Tonkpils/cli/subscribers","subscription_url":"https://api.github.com/repos/Tonkpils/cli/subscription","commits_url":"https://api.github.com/repos/Tonkpils/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tonkpils/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tonkpils/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tonkpils/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tonkpils/cli/contents/{+path}","compare_url":"https://api.github.com/repos/Tonkpils/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tonkpils/cli/merges","archive_url":"https://api.github.com/repos/Tonkpils/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tonkpils/cli/downloads","issues_url":"https://api.github.com/repos/Tonkpils/cli/issues{/number}","pulls_url":"https://api.github.com/repos/Tonkpils/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/Tonkpils/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/Tonkpils/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tonkpils/cli/labels{/name}","releases_url":"https://api.github.com/repos/Tonkpils/cli/releases{/id}","created_at":"2013-09-26T19:07:23Z","updated_at":"2015-04-29T23:14:23Z","pushed_at":"2015-05-20T21:13:54Z","git_url":"git://github.com/Tonkpils/cli.git","ssh_url":"git@github.com:Tonkpils/cli.git","clone_url":"https://github.com/Tonkpils/cli.git","svn_url":"https://github.com/Tonkpils/cli","homepage":null,"size":2256,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"exercism:master","ref":"master","sha":"1df44bfa3b325e1b49f25a8e947542b995eef2a7","user":{"login":"exercism","id":5624255,"avatar_url":"https://avatars.githubusercontent.com/u/5624255?v=3","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"repo":{"id":11870975,"name":"cli","full_name":"exercism/cli","owner":{"login":"exercism","id":5624255,"avatar_url":"https://avatars.githubusercontent.com/u/5624255?v=3","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exercism/cli","description":"A Go based command line tool for exercism.io.","fork":false,"url":"https://api.github.com/repos/exercism/cli","forks_url":"https://api.github.com/repos/exercism/cli/forks","keys_url":"https://api.github.com/repos/exercism/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exercism/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exercism/cli/teams","hooks_url":"https://api.github.com/repos/exercism/cli/hooks","issue_events_url":"https://api.github.com/repos/exercism/cli/issues/events{/number}","events_url":"https://api.github.com/repos/exercism/cli/events","assignees_url":"https://api.github.com/repos/exercism/cli/assignees{/user}","branches_url":"https://api.github.com/repos/exercism/cli/branches{/branch}","tags_url":"https://api.github.com/repos/exercism/cli/tags","blobs_url":"https://api.github.com/repos/exercism/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exercism/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exercism/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/exercism/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exercism/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/exercism/cli/languages","stargazers_url":"https://api.github.com/repos/exercism/cli/stargazers","contributors_url":"https://api.github.com/repos/exercism/cli/contributors","subscribers_url":"https://api.github.com/repos/exercism/cli/subscribers","subscription_url":"https://api.github.com/repos/exercism/cli/subscription","commits_url":"https://api.github.com/repos/exercism/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/exercism/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/exercism/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/exercism/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/exercism/cli/contents/{+path}","compare_url":"https://api.github.com/repos/exercism/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exercism/cli/merges","archive_url":"https://api.github.com/repos/exercism/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exercism/cli/downloads","issues_url":"https://api.github.com/repos/exercism/cli/issues{/number}","pulls_url":"https://api.github.com/repos/exercism/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/exercism/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/exercism/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exercism/cli/labels{/name}","releases_url":"https://api.github.com/repos/exercism/cli/releases{/id}","created_at":"2013-08-03T23:10:38Z","updated_at":"2015-05-20T16:15:36Z","pushed_at":"2015-05-20T21:13:55Z","git_url":"git://github.com/exercism/cli.git","ssh_url":"git@github.com:exercism/cli.git","clone_url":"https://github.com/exercism/cli.git","svn_url":"https://github.com/exercism/cli","homepage":null,"size":5806,"stargazers_count":231,"watchers_count":231,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":96,"mirror_url":null,"open_issues_count":14,"forks":96,"open_issues":14,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exercism/cli/pulls/195"},"html":{"href":"https://github.com/exercism/cli/pull/195"},"issue":{"href":"https://api.github.com/repos/exercism/cli/issues/195"},"comments":{"href":"https://api.github.com/repos/exercism/cli/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/exercism/cli/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/exercism/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exercism/cli/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/exercism/cli/statuses/68f437f471a03e07765e922b25f26c5566d3fc26"}}}}