{"action":"created","comment":{"url":"https://api.github.com/repos/phrase/phraseapp-client/pulls/comments/49998414","id":49998414,"diff_hunk":"@@ -23,3 +30,65 @@ func Run() {\n \t\tos.Exit(1)\n \t}\n }\n+\n+const PHRASEAPP_VERSION_TMP_FILE = \"/tmp/.phraseapp.version\"\n+\n+func validateVersion() {\n+\tvar version string\n+\tstat, err := os.Stat(PHRASEAPP_VERSION_TMP_FILE)\n+\tif PHRASEAPP_CLIENT_VERSION == \"test\" {\n+\t\t// do nothing, we're in development mode\n+\t} else if os.IsNotExist(err) || time.Now().Sub(stat.ModTime()) > time.Hour {","path":"main.go","position":33,"original_position":33,"commit_id":"ffc981a0b88864cdd97043db3f7d3749ca0d8cee","original_commit_id":"ffc981a0b88864cdd97043db3f7d3749ca0d8cee","user":{"login":"tobstarr","id":5281,"avatar_url":"https://avatars.githubusercontent.com/u/5281?v=3","gravatar_id":"","url":"https://api.github.com/users/tobstarr","html_url":"https://github.com/tobstarr","followers_url":"https://api.github.com/users/tobstarr/followers","following_url":"https://api.github.com/users/tobstarr/following{/other_user}","gists_url":"https://api.github.com/users/tobstarr/gists{/gist_id}","starred_url":"https://api.github.com/users/tobstarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobstarr/subscriptions","organizations_url":"https://api.github.com/users/tobstarr/orgs","repos_url":"https://api.github.com/users/tobstarr/repos","events_url":"https://api.github.com/users/tobstarr/events{/privacy}","received_events_url":"https://api.github.com/users/tobstarr/received_events","type":"User","site_admin":false},"body":"`time.Since` would do the same trick","created_at":"2016-01-18T13:32:02Z","updated_at":"2016-01-18T13:32:02Z","html_url":"https://github.com/phrase/phraseapp-client/pull/24#discussion_r49998414","pull_request_url":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/phrase/phraseapp-client/pulls/comments/49998414"},"html":{"href":"https://github.com/phrase/phraseapp-client/pull/24#discussion_r49998414"},"pull_request":{"href":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24","id":56048000,"html_url":"https://github.com/phrase/phraseapp-client/pull/24","diff_url":"https://github.com/phrase/phraseapp-client/pull/24.diff","patch_url":"https://github.com/phrase/phraseapp-client/pull/24.patch","issue_url":"https://api.github.com/repos/phrase/phraseapp-client/issues/24","number":24,"state":"open","locked":false,"title":"client: add update notification on outdated version","user":{"login":"gfrey","id":519838,"avatar_url":"https://avatars.githubusercontent.com/u/519838?v=3","gravatar_id":"","url":"https://api.github.com/users/gfrey","html_url":"https://github.com/gfrey","followers_url":"https://api.github.com/users/gfrey/followers","following_url":"https://api.github.com/users/gfrey/following{/other_user}","gists_url":"https://api.github.com/users/gfrey/gists{/gist_id}","starred_url":"https://api.github.com/users/gfrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfrey/subscriptions","organizations_url":"https://api.github.com/users/gfrey/orgs","repos_url":"https://api.github.com/users/gfrey/repos","events_url":"https://api.github.com/users/gfrey/events{/privacy}","received_events_url":"https://api.github.com/users/gfrey/received_events","type":"User","site_admin":false},"body":"The client will now show a message if the version of the PhraseApp CLI\r\nclient doesn't match the latest version on github. There are some safety\r\nmeasures:\r\n* The HEAD request against github is done only once per hour. This\r\n  version is saved in /tmp/.phraseapp.version.\r\n* All errors related to the HTTP request or file handling are ignored.\r\n  Show nothing if you can't be sure.\r\n* In development mode the user is notified this is not a released\r\n  client.","created_at":"2016-01-14T15:19:24Z","updated_at":"2016-01-18T13:32:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1ce1d5cc1140a03277fd0391e2d791a2ae5f2b4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24/commits","review_comments_url":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24/comments","review_comment_url":"https://api.github.com/repos/phrase/phraseapp-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phrase/phraseapp-client/issues/24/comments","statuses_url":"https://api.github.com/repos/phrase/phraseapp-client/statuses/ffc981a0b88864cdd97043db3f7d3749ca0d8cee","head":{"label":"phrase:209_update_notification","ref":"209_update_notification","sha":"ffc981a0b88864cdd97043db3f7d3749ca0d8cee","user":{"login":"phrase","id":1502287,"avatar_url":"https://avatars.githubusercontent.com/u/1502287?v=3","gravatar_id":"","url":"https://api.github.com/users/phrase","html_url":"https://github.com/phrase","followers_url":"https://api.github.com/users/phrase/followers","following_url":"https://api.github.com/users/phrase/following{/other_user}","gists_url":"https://api.github.com/users/phrase/gists{/gist_id}","starred_url":"https://api.github.com/users/phrase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phrase/subscriptions","organizations_url":"https://api.github.com/users/phrase/orgs","repos_url":"https://api.github.com/users/phrase/repos","events_url":"https://api.github.com/users/phrase/events{/privacy}","received_events_url":"https://api.github.com/users/phrase/received_events","type":"Organization","site_admin":false},"repo":{"id":32396643,"name":"phraseapp-client","full_name":"phrase/phraseapp-client","owner":{"login":"phrase","id":1502287,"avatar_url":"https://avatars.githubusercontent.com/u/1502287?v=3","gravatar_id":"","url":"https://api.github.com/users/phrase","html_url":"https://github.com/phrase","followers_url":"https://api.github.com/users/phrase/followers","following_url":"https://api.github.com/users/phrase/following{/other_user}","gists_url":"https://api.github.com/users/phrase/gists{/gist_id}","starred_url":"https://api.github.com/users/phrase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phrase/subscriptions","organizations_url":"https://api.github.com/users/phrase/orgs","repos_url":"https://api.github.com/users/phrase/repos","events_url":"https://api.github.com/users/phrase/events{/privacy}","received_events_url":"https://api.github.com/users/phrase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phrase/phraseapp-client","description":"PhraseApp API v2 Command Line Client","fork":false,"url":"https://api.github.com/repos/phrase/phraseapp-client","forks_url":"https://api.github.com/repos/phrase/phraseapp-client/forks","keys_url":"https://api.github.com/repos/phrase/phraseapp-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phrase/phraseapp-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phrase/phraseapp-client/teams","hooks_url":"https://api.github.com/repos/phrase/phraseapp-client/hooks","issue_events_url":"https://api.github.com/repos/phrase/phraseapp-client/issues/events{/number}","events_url":"https://api.github.com/repos/phrase/phraseapp-client/events","assignees_url":"https://api.github.com/repos/phrase/phraseapp-client/assignees{/user}","branches_url":"https://api.github.com/repos/phrase/phraseapp-client/branches{/branch}","tags_url":"https://api.github.com/repos/phrase/phraseapp-client/tags","blobs_url":"https://api.github.com/repos/phrase/phraseapp-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phrase/phraseapp-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phrase/phraseapp-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/phrase/phraseapp-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phrase/phraseapp-client/statuses/{sha}","languages_url":"https://api.github.com/repos/phrase/phraseapp-client/languages","stargazers_url":"https://api.github.com/repos/phrase/phraseapp-client/stargazers","contributors_url":"https://api.github.com/repos/phrase/phraseapp-client/contributors","subscribers_url":"https://api.github.com/repos/phrase/phraseapp-client/subscribers","subscription_url":"https://api.github.com/repos/phrase/phraseapp-client/subscription","commits_url":"https://api.github.com/repos/phrase/phraseapp-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/phrase/phraseapp-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/phrase/phraseapp-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/phrase/phraseapp-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/phrase/phraseapp-client/contents/{+path}","compare_url":"https://api.github.com/repos/phrase/phraseapp-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phrase/phraseapp-client/merges","archive_url":"https://api.github.com/repos/phrase/phraseapp-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phrase/phraseapp-client/downloads","issues_url":"https://api.github.com/repos/phrase/phraseapp-client/issues{/number}","pulls_url":"https://api.github.com/repos/phrase/phraseapp-client/pulls{/number}","milestones_url":"https://api.github.com/repos/phrase/phraseapp-client/milestones{/number}","notifications_url":"https://api.github.com/repos/phrase/phraseapp-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phrase/phraseapp-client/labels{/name}","releases_url":"https://api.github.com/repos/phrase/phraseapp-client/releases{/id}","created_at":"2015-03-17T13:59:27Z","updated_at":"2015-11-05T14:53:12Z","pushed_at":"2016-01-18T11:49:04Z","git_url":"git://github.com/phrase/phraseapp-client.git","ssh_url":"git@github.com:phrase/phraseapp-client.git","clone_url":"https://github.com/phrase/phraseapp-client.git","svn_url":"https://github.com/phrase/phraseapp-client","homepage":"http://docs.phraseapp.com","size":495,"stargazers_count":38,"watchers_count":38,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":3,"forks":17,"open_issues":3,"watchers":38,"default_branch":"master"}},"base":{"label":"phrase:master","ref":"master","sha":"fdd80d2934e1da92f8f529c3766820979f4a9c18","user":{"login":"phrase","id":1502287,"avatar_url":"https://avatars.githubusercontent.com/u/1502287?v=3","gravatar_id":"","url":"https://api.github.com/users/phrase","html_url":"https://github.com/phrase","followers_url":"https://api.github.com/users/phrase/followers","following_url":"https://api.github.com/users/phrase/following{/other_user}","gists_url":"https://api.github.com/users/phrase/gists{/gist_id}","starred_url":"https://api.github.com/users/phrase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phrase/subscriptions","organizations_url":"https://api.github.com/users/phrase/orgs","repos_url":"https://api.github.com/users/phrase/repos","events_url":"https://api.github.com/users/phrase/events{/privacy}","received_events_url":"https://api.github.com/users/phrase/received_events","type":"Organization","site_admin":false},"repo":{"id":32396643,"name":"phraseapp-client","full_name":"phrase/phraseapp-client","owner":{"login":"phrase","id":1502287,"avatar_url":"https://avatars.githubusercontent.com/u/1502287?v=3","gravatar_id":"","url":"https://api.github.com/users/phrase","html_url":"https://github.com/phrase","followers_url":"https://api.github.com/users/phrase/followers","following_url":"https://api.github.com/users/phrase/following{/other_user}","gists_url":"https://api.github.com/users/phrase/gists{/gist_id}","starred_url":"https://api.github.com/users/phrase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phrase/subscriptions","organizations_url":"https://api.github.com/users/phrase/orgs","repos_url":"https://api.github.com/users/phrase/repos","events_url":"https://api.github.com/users/phrase/events{/privacy}","received_events_url":"https://api.github.com/users/phrase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phrase/phraseapp-client","description":"PhraseApp API v2 Command Line Client","fork":false,"url":"https://api.github.com/repos/phrase/phraseapp-client","forks_url":"https://api.github.com/repos/phrase/phraseapp-client/forks","keys_url":"https://api.github.com/repos/phrase/phraseapp-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phrase/phraseapp-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phrase/phraseapp-client/teams","hooks_url":"https://api.github.com/repos/phrase/phraseapp-client/hooks","issue_events_url":"https://api.github.com/repos/phrase/phraseapp-client/issues/events{/number}","events_url":"https://api.github.com/repos/phrase/phraseapp-client/events","assignees_url":"https://api.github.com/repos/phrase/phraseapp-client/assignees{/user}","branches_url":"https://api.github.com/repos/phrase/phraseapp-client/branches{/branch}","tags_url":"https://api.github.com/repos/phrase/phraseapp-client/tags","blobs_url":"https://api.github.com/repos/phrase/phraseapp-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phrase/phraseapp-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phrase/phraseapp-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/phrase/phraseapp-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phrase/phraseapp-client/statuses/{sha}","languages_url":"https://api.github.com/repos/phrase/phraseapp-client/languages","stargazers_url":"https://api.github.com/repos/phrase/phraseapp-client/stargazers","contributors_url":"https://api.github.com/repos/phrase/phraseapp-client/contributors","subscribers_url":"https://api.github.com/repos/phrase/phraseapp-client/subscribers","subscription_url":"https://api.github.com/repos/phrase/phraseapp-client/subscription","commits_url":"https://api.github.com/repos/phrase/phraseapp-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/phrase/phraseapp-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/phrase/phraseapp-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/phrase/phraseapp-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/phrase/phraseapp-client/contents/{+path}","compare_url":"https://api.github.com/repos/phrase/phraseapp-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phrase/phraseapp-client/merges","archive_url":"https://api.github.com/repos/phrase/phraseapp-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phrase/phraseapp-client/downloads","issues_url":"https://api.github.com/repos/phrase/phraseapp-client/issues{/number}","pulls_url":"https://api.github.com/repos/phrase/phraseapp-client/pulls{/number}","milestones_url":"https://api.github.com/repos/phrase/phraseapp-client/milestones{/number}","notifications_url":"https://api.github.com/repos/phrase/phraseapp-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phrase/phraseapp-client/labels{/name}","releases_url":"https://api.github.com/repos/phrase/phraseapp-client/releases{/id}","created_at":"2015-03-17T13:59:27Z","updated_at":"2015-11-05T14:53:12Z","pushed_at":"2016-01-18T11:49:04Z","git_url":"git://github.com/phrase/phraseapp-client.git","ssh_url":"git@github.com:phrase/phraseapp-client.git","clone_url":"https://github.com/phrase/phraseapp-client.git","svn_url":"https://github.com/phrase/phraseapp-client","homepage":"http://docs.phraseapp.com","size":495,"stargazers_count":38,"watchers_count":38,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":3,"forks":17,"open_issues":3,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24"},"html":{"href":"https://github.com/phrase/phraseapp-client/pull/24"},"issue":{"href":"https://api.github.com/repos/phrase/phraseapp-client/issues/24"},"comments":{"href":"https://api.github.com/repos/phrase/phraseapp-client/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/phrase/phraseapp-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phrase/phraseapp-client/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/phrase/phraseapp-client/statuses/ffc981a0b88864cdd97043db3f7d3749ca0d8cee"}}}}