{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/win-release/pulls/comments/38010011","id":38010011,"diff_hunk":"@@ -15,11 +16,20 @@ var nameMap = {\n };\n \n module.exports = function (release) {\n-\tvar version = /\\d+\\.\\d+/.exec(release || os.release());\n+\tvar verRe = /\\d+\\.\\d+/;\n+\tvar version;\n \n-\tif (!version) {\n+\tif (release || semver.gte(process.version, '3.1.0')) {\n+\t\tversion = verRe.exec(release || os.release());\n+\t} else {\n+\t\t// Workaround for Windows 10 on node < 3.1.0\n+\t\tvar execSync = require('child_process').execSync;\n+\t\tversion = verRe.exec(String(execSync('ver.exe', {timeout: 1e5})));","path":"index.js","position":21,"original_position":21,"commit_id":"b5aa98b28055bf29cff6880b4d3a684b4ddc7104","original_commit_id":"b5aa98b28055bf29cff6880b4d3a684b4ddc7104","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"body":"`execSync` doesn't work on Node 0.10, which unfortunately this module needs to support, can you use https://github.com/sindresorhus/exec-file-sync instead?","created_at":"2015-08-26T17:29:39Z","updated_at":"2015-08-26T17:29:39Z","html_url":"https://github.com/sindresorhus/win-release/pull/3#discussion_r38010011","pull_request_url":"https://api.github.com/repos/sindresorhus/win-release/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/win-release/pulls/comments/38010011"},"html":{"href":"https://github.com/sindresorhus/win-release/pull/3#discussion_r38010011"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/win-release/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/win-release/pulls/3","id":43428589,"html_url":"https://github.com/sindresorhus/win-release/pull/3","diff_url":"https://github.com/sindresorhus/win-release/pull/3.diff","patch_url":"https://github.com/sindresorhus/win-release/pull/3.patch","issue_url":"https://api.github.com/repos/sindresorhus/win-release/issues/3","number":3,"state":"open","locked":false,"title":"workaround os.release() issue on Windows 10","user":{"login":"silverwind","id":115237,"avatar_url":"https://avatars.githubusercontent.com/u/115237?v=3","gravatar_id":"","url":"https://api.github.com/users/silverwind","html_url":"https://github.com/silverwind","followers_url":"https://api.github.com/users/silverwind/followers","following_url":"https://api.github.com/users/silverwind/following{/other_user}","gists_url":"https://api.github.com/users/silverwind/gists{/gist_id}","starred_url":"https://api.github.com/users/silverwind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverwind/subscriptions","organizations_url":"https://api.github.com/users/silverwind/orgs","repos_url":"https://api.github.com/users/silverwind/repos","events_url":"https://api.github.com/users/silverwind/events{/privacy}","received_events_url":"https://api.github.com/users/silverwind/received_events","type":"User","site_admin":false},"body":"- Added a workaround, based on https://github.com/atom/electron/issues/2586#issuecomment-134913756.\r\n- Added a safeguard on the `return` in case the regex doesn't match (unlikely).\r\n\r\n`ver.exe` returns this string on Windows 10 for reference:\r\n```js\r\n'\\r\\nMicrosoft Windows [Version 10.0.10240]\\r\\n'\r\n```","created_at":"2015-08-26T17:25:08Z","updated_at":"2015-08-26T17:29:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1022ff294661c05f747068ddf86db177af157dd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/win-release/pulls/3/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/win-release/pulls/3/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/win-release/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/win-release/issues/3/comments","statuses_url":"https://api.github.com/repos/sindresorhus/win-release/statuses/b5aa98b28055bf29cff6880b4d3a684b4ddc7104","head":{"label":"silverwind:master","ref":"master","sha":"b5aa98b28055bf29cff6880b4d3a684b4ddc7104","user":{"login":"silverwind","id":115237,"avatar_url":"https://avatars.githubusercontent.com/u/115237?v=3","gravatar_id":"","url":"https://api.github.com/users/silverwind","html_url":"https://github.com/silverwind","followers_url":"https://api.github.com/users/silverwind/followers","following_url":"https://api.github.com/users/silverwind/following{/other_user}","gists_url":"https://api.github.com/users/silverwind/gists{/gist_id}","starred_url":"https://api.github.com/users/silverwind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverwind/subscriptions","organizations_url":"https://api.github.com/users/silverwind/orgs","repos_url":"https://api.github.com/users/silverwind/repos","events_url":"https://api.github.com/users/silverwind/events{/privacy}","received_events_url":"https://api.github.com/users/silverwind/received_events","type":"User","site_admin":false},"repo":{"id":41344127,"name":"win-release","full_name":"silverwind/win-release","owner":{"login":"silverwind","id":115237,"avatar_url":"https://avatars.githubusercontent.com/u/115237?v=3","gravatar_id":"","url":"https://api.github.com/users/silverwind","html_url":"https://github.com/silverwind","followers_url":"https://api.github.com/users/silverwind/followers","following_url":"https://api.github.com/users/silverwind/following{/other_user}","gists_url":"https://api.github.com/users/silverwind/gists{/gist_id}","starred_url":"https://api.github.com/users/silverwind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverwind/subscriptions","organizations_url":"https://api.github.com/users/silverwind/orgs","repos_url":"https://api.github.com/users/silverwind/repos","events_url":"https://api.github.com/users/silverwind/events{/privacy}","received_events_url":"https://api.github.com/users/silverwind/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/silverwind/win-release","description":"Get the name of a Windows version from the release number: 5.1.2600 → XP","fork":true,"url":"https://api.github.com/repos/silverwind/win-release","forks_url":"https://api.github.com/repos/silverwind/win-release/forks","keys_url":"https://api.github.com/repos/silverwind/win-release/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silverwind/win-release/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silverwind/win-release/teams","hooks_url":"https://api.github.com/repos/silverwind/win-release/hooks","issue_events_url":"https://api.github.com/repos/silverwind/win-release/issues/events{/number}","events_url":"https://api.github.com/repos/silverwind/win-release/events","assignees_url":"https://api.github.com/repos/silverwind/win-release/assignees{/user}","branches_url":"https://api.github.com/repos/silverwind/win-release/branches{/branch}","tags_url":"https://api.github.com/repos/silverwind/win-release/tags","blobs_url":"https://api.github.com/repos/silverwind/win-release/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silverwind/win-release/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silverwind/win-release/git/refs{/sha}","trees_url":"https://api.github.com/repos/silverwind/win-release/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silverwind/win-release/statuses/{sha}","languages_url":"https://api.github.com/repos/silverwind/win-release/languages","stargazers_url":"https://api.github.com/repos/silverwind/win-release/stargazers","contributors_url":"https://api.github.com/repos/silverwind/win-release/contributors","subscribers_url":"https://api.github.com/repos/silverwind/win-release/subscribers","subscription_url":"https://api.github.com/repos/silverwind/win-release/subscription","commits_url":"https://api.github.com/repos/silverwind/win-release/commits{/sha}","git_commits_url":"https://api.github.com/repos/silverwind/win-release/git/commits{/sha}","comments_url":"https://api.github.com/repos/silverwind/win-release/comments{/number}","issue_comment_url":"https://api.github.com/repos/silverwind/win-release/issues/comments{/number}","contents_url":"https://api.github.com/repos/silverwind/win-release/contents/{+path}","compare_url":"https://api.github.com/repos/silverwind/win-release/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silverwind/win-release/merges","archive_url":"https://api.github.com/repos/silverwind/win-release/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silverwind/win-release/downloads","issues_url":"https://api.github.com/repos/silverwind/win-release/issues{/number}","pulls_url":"https://api.github.com/repos/silverwind/win-release/pulls{/number}","milestones_url":"https://api.github.com/repos/silverwind/win-release/milestones{/number}","notifications_url":"https://api.github.com/repos/silverwind/win-release/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silverwind/win-release/labels{/name}","releases_url":"https://api.github.com/repos/silverwind/win-release/releases{/id}","created_at":"2015-08-25T05:09:30Z","updated_at":"2015-08-25T05:09:31Z","pushed_at":"2015-08-26T17:27:05Z","git_url":"git://github.com/silverwind/win-release.git","ssh_url":"git@github.com:silverwind/win-release.git","clone_url":"https://github.com/silverwind/win-release.git","svn_url":"https://github.com/silverwind/win-release","homepage":null,"size":144,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"sindresorhus:master","ref":"master","sha":"981895059f992093df9a158cf885340c72ec1433","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":29387947,"name":"win-release","full_name":"sindresorhus/win-release","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/win-release","description":"Get the name of a Windows version from the release number: 5.1.2600 → XP","fork":false,"url":"https://api.github.com/repos/sindresorhus/win-release","forks_url":"https://api.github.com/repos/sindresorhus/win-release/forks","keys_url":"https://api.github.com/repos/sindresorhus/win-release/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/win-release/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/win-release/teams","hooks_url":"https://api.github.com/repos/sindresorhus/win-release/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/win-release/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/win-release/events","assignees_url":"https://api.github.com/repos/sindresorhus/win-release/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/win-release/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/win-release/tags","blobs_url":"https://api.github.com/repos/sindresorhus/win-release/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/win-release/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/win-release/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/win-release/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/win-release/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/win-release/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/win-release/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/win-release/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/win-release/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/win-release/subscription","commits_url":"https://api.github.com/repos/sindresorhus/win-release/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/win-release/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/win-release/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/win-release/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/win-release/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/win-release/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/win-release/merges","archive_url":"https://api.github.com/repos/sindresorhus/win-release/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/win-release/downloads","issues_url":"https://api.github.com/repos/sindresorhus/win-release/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/win-release/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/win-release/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/win-release/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/win-release/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/win-release/releases{/id}","created_at":"2015-01-17T10:40:50Z","updated_at":"2015-08-25T15:10:56Z","pushed_at":"2015-08-26T17:27:05Z","git_url":"git://github.com/sindresorhus/win-release.git","ssh_url":"git@github.com:sindresorhus/win-release.git","clone_url":"https://github.com/sindresorhus/win-release.git","svn_url":"https://github.com/sindresorhus/win-release","homepage":null,"size":144,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/win-release/pulls/3"},"html":{"href":"https://github.com/sindresorhus/win-release/pull/3"},"issue":{"href":"https://api.github.com/repos/sindresorhus/win-release/issues/3"},"comments":{"href":"https://api.github.com/repos/sindresorhus/win-release/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/win-release/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/win-release/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/win-release/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/win-release/statuses/b5aa98b28055bf29cff6880b4d3a684b4ddc7104"}}}}