{"action":"created","comment":{"url":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/comments/120087508","pull_request_review_id":42021301,"id":120087508,"diff_hunk":"@@ -75,18 +75,17 @@ export function getBinPath(tool: string): string {\n         _pathesCache[tool] = pathparts.map(dir => path.join(dir, correctBinname(tool))).filter(candidate => fs.existsSync(candidate))[0];\n         if (process.platform !== 'win32') {\n             try {\n-                let buff;\n+                let nimPath;\n                 if (process.platform === 'darwin') {\n-                    // dirty hack because the version of readlink that ships with osx doesn't support the -f flag\n-                    // from https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac#4031502\n-                    buff = cp.execFileSync('python', ['-c', 'import os,sys;print(os.path.realpath(sys.argv[1]))', _pathesCache[tool]]);\n+                    nimPath = _pathesCache[tool].slice(0, _pathesCache[tool].length - 3) + cp.execFileSync('readlink', [_pathesCache[tool]]).toString().trim();","path":"src/nimUtils.ts","position":null,"original_position":10,"commit_id":"1d328ad61a4f314839764ccdb3d43e48c0e05978","original_commit_id":"1d328ad61a4f314839764ccdb3d43e48c0e05978","user":{"login":"kosz78","id":3992195,"avatar_url":"https://avatars1.githubusercontent.com/u/3992195?v=3","gravatar_id":"","url":"https://api.github.com/users/kosz78","html_url":"https://github.com/kosz78","followers_url":"https://api.github.com/users/kosz78/followers","following_url":"https://api.github.com/users/kosz78/following{/other_user}","gists_url":"https://api.github.com/users/kosz78/gists{/gist_id}","starred_url":"https://api.github.com/users/kosz78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosz78/subscriptions","organizations_url":"https://api.github.com/users/kosz78/orgs","repos_url":"https://api.github.com/users/kosz78/repos","events_url":"https://api.github.com/users/kosz78/events{/privacy}","received_events_url":"https://api.github.com/users/kosz78/received_events","type":"User","site_admin":false},"body":"I guess it will not work for all cases becasue link can be relative or absolute and you need prepend `_pathesCache[tool].slice(0, _pathesCache[tool].length - 3)` only in case of relative path (not start with `/` )","created_at":"2017-06-05T11:10:56Z","updated_at":"2017-06-05T11:10:56Z","html_url":"https://github.com/pragmagic/vscode-nim/pull/52#discussion_r120087508","pull_request_url":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/comments/120087508"},"html":{"href":"https://github.com/pragmagic/vscode-nim/pull/52#discussion_r120087508"},"pull_request":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52","id":123384990,"html_url":"https://github.com/pragmagic/vscode-nim/pull/52","diff_url":"https://github.com/pragmagic/vscode-nim/pull/52.diff","patch_url":"https://github.com/pragmagic/vscode-nim/pull/52.patch","issue_url":"https://api.github.com/repos/pragmagic/vscode-nim/issues/52","number":52,"state":"open","locked":false,"title":"Fixing 'nim' binary could not be found in PATH on OS X","user":{"login":"YsenGrimm","id":882186,"avatar_url":"https://avatars0.githubusercontent.com/u/882186?v=3","gravatar_id":"","url":"https://api.github.com/users/YsenGrimm","html_url":"https://github.com/YsenGrimm","followers_url":"https://api.github.com/users/YsenGrimm/followers","following_url":"https://api.github.com/users/YsenGrimm/following{/other_user}","gists_url":"https://api.github.com/users/YsenGrimm/gists{/gist_id}","starred_url":"https://api.github.com/users/YsenGrimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YsenGrimm/subscriptions","organizations_url":"https://api.github.com/users/YsenGrimm/orgs","repos_url":"https://api.github.com/users/YsenGrimm/repos","events_url":"https://api.github.com/users/YsenGrimm/events{/privacy}","received_events_url":"https://api.github.com/users/YsenGrimm/received_events","type":"User","site_admin":false},"body":"The output of ```readlink``` without the -f flag is a non absolute path. As a result, if you used brew to install nim, the correct binary can't be detected and the error message is shown.\r\n\r\nSee https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac#4031502 on the readlink problem and a solution.\r\n\r\nMy solution is a bit hacky but should work on all OS X versions.","created_at":"2017-05-31T22:40:07Z","updated_at":"2017-06-05T11:10:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0360551158bbe23cec98dfe3684bb43fee42ecb","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52/commits","review_comments_url":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52/comments","review_comment_url":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pragmagic/vscode-nim/issues/52/comments","statuses_url":"https://api.github.com/repos/pragmagic/vscode-nim/statuses/1d328ad61a4f314839764ccdb3d43e48c0e05978","head":{"label":"YsenGrimm:master","ref":"master","sha":"1d328ad61a4f314839764ccdb3d43e48c0e05978","user":{"login":"YsenGrimm","id":882186,"avatar_url":"https://avatars0.githubusercontent.com/u/882186?v=3","gravatar_id":"","url":"https://api.github.com/users/YsenGrimm","html_url":"https://github.com/YsenGrimm","followers_url":"https://api.github.com/users/YsenGrimm/followers","following_url":"https://api.github.com/users/YsenGrimm/following{/other_user}","gists_url":"https://api.github.com/users/YsenGrimm/gists{/gist_id}","starred_url":"https://api.github.com/users/YsenGrimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YsenGrimm/subscriptions","organizations_url":"https://api.github.com/users/YsenGrimm/orgs","repos_url":"https://api.github.com/users/YsenGrimm/repos","events_url":"https://api.github.com/users/YsenGrimm/events{/privacy}","received_events_url":"https://api.github.com/users/YsenGrimm/received_events","type":"User","site_admin":false},"repo":{"id":92988968,"name":"vscode-nim","full_name":"YsenGrimm/vscode-nim","owner":{"login":"YsenGrimm","id":882186,"avatar_url":"https://avatars0.githubusercontent.com/u/882186?v=3","gravatar_id":"","url":"https://api.github.com/users/YsenGrimm","html_url":"https://github.com/YsenGrimm","followers_url":"https://api.github.com/users/YsenGrimm/followers","following_url":"https://api.github.com/users/YsenGrimm/following{/other_user}","gists_url":"https://api.github.com/users/YsenGrimm/gists{/gist_id}","starred_url":"https://api.github.com/users/YsenGrimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YsenGrimm/subscriptions","organizations_url":"https://api.github.com/users/YsenGrimm/orgs","repos_url":"https://api.github.com/users/YsenGrimm/repos","events_url":"https://api.github.com/users/YsenGrimm/events{/privacy}","received_events_url":"https://api.github.com/users/YsenGrimm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YsenGrimm/vscode-nim","description":"An extension for VS Code which provides support for the Nim language.","fork":true,"url":"https://api.github.com/repos/YsenGrimm/vscode-nim","forks_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/forks","keys_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/teams","hooks_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/hooks","issue_events_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/issues/events{/number}","events_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/events","assignees_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/assignees{/user}","branches_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/branches{/branch}","tags_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/tags","blobs_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/git/refs{/sha}","trees_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/statuses/{sha}","languages_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/languages","stargazers_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/stargazers","contributors_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/contributors","subscribers_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/subscribers","subscription_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/subscription","commits_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/commits{/sha}","git_commits_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/git/commits{/sha}","comments_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/comments{/number}","issue_comment_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/issues/comments{/number}","contents_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/contents/{+path}","compare_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/merges","archive_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/downloads","issues_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/issues{/number}","pulls_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/pulls{/number}","milestones_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/milestones{/number}","notifications_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/labels{/name}","releases_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/releases{/id}","deployments_url":"https://api.github.com/repos/YsenGrimm/vscode-nim/deployments","created_at":"2017-05-31T21:09:28Z","updated_at":"2017-05-31T21:09:29Z","pushed_at":"2017-06-04T17:08:36Z","git_url":"git://github.com/YsenGrimm/vscode-nim.git","ssh_url":"git@github.com:YsenGrimm/vscode-nim.git","clone_url":"https://github.com/YsenGrimm/vscode-nim.git","svn_url":"https://github.com/YsenGrimm/vscode-nim","homepage":null,"size":169,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"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":"pragmagic:master","ref":"master","sha":"c4e4d57f39243b7fcdc845fd8be8234e5aee26dc","user":{"login":"pragmagic","id":8536602,"avatar_url":"https://avatars1.githubusercontent.com/u/8536602?v=3","gravatar_id":"","url":"https://api.github.com/users/pragmagic","html_url":"https://github.com/pragmagic","followers_url":"https://api.github.com/users/pragmagic/followers","following_url":"https://api.github.com/users/pragmagic/following{/other_user}","gists_url":"https://api.github.com/users/pragmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/pragmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pragmagic/subscriptions","organizations_url":"https://api.github.com/users/pragmagic/orgs","repos_url":"https://api.github.com/users/pragmagic/repos","events_url":"https://api.github.com/users/pragmagic/events{/privacy}","received_events_url":"https://api.github.com/users/pragmagic/received_events","type":"Organization","site_admin":false},"repo":{"id":51753808,"name":"vscode-nim","full_name":"pragmagic/vscode-nim","owner":{"login":"pragmagic","id":8536602,"avatar_url":"https://avatars1.githubusercontent.com/u/8536602?v=3","gravatar_id":"","url":"https://api.github.com/users/pragmagic","html_url":"https://github.com/pragmagic","followers_url":"https://api.github.com/users/pragmagic/followers","following_url":"https://api.github.com/users/pragmagic/following{/other_user}","gists_url":"https://api.github.com/users/pragmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/pragmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pragmagic/subscriptions","organizations_url":"https://api.github.com/users/pragmagic/orgs","repos_url":"https://api.github.com/users/pragmagic/repos","events_url":"https://api.github.com/users/pragmagic/events{/privacy}","received_events_url":"https://api.github.com/users/pragmagic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pragmagic/vscode-nim","description":"An extension for VS Code which provides support for the Nim language.","fork":false,"url":"https://api.github.com/repos/pragmagic/vscode-nim","forks_url":"https://api.github.com/repos/pragmagic/vscode-nim/forks","keys_url":"https://api.github.com/repos/pragmagic/vscode-nim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pragmagic/vscode-nim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pragmagic/vscode-nim/teams","hooks_url":"https://api.github.com/repos/pragmagic/vscode-nim/hooks","issue_events_url":"https://api.github.com/repos/pragmagic/vscode-nim/issues/events{/number}","events_url":"https://api.github.com/repos/pragmagic/vscode-nim/events","assignees_url":"https://api.github.com/repos/pragmagic/vscode-nim/assignees{/user}","branches_url":"https://api.github.com/repos/pragmagic/vscode-nim/branches{/branch}","tags_url":"https://api.github.com/repos/pragmagic/vscode-nim/tags","blobs_url":"https://api.github.com/repos/pragmagic/vscode-nim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pragmagic/vscode-nim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pragmagic/vscode-nim/git/refs{/sha}","trees_url":"https://api.github.com/repos/pragmagic/vscode-nim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pragmagic/vscode-nim/statuses/{sha}","languages_url":"https://api.github.com/repos/pragmagic/vscode-nim/languages","stargazers_url":"https://api.github.com/repos/pragmagic/vscode-nim/stargazers","contributors_url":"https://api.github.com/repos/pragmagic/vscode-nim/contributors","subscribers_url":"https://api.github.com/repos/pragmagic/vscode-nim/subscribers","subscription_url":"https://api.github.com/repos/pragmagic/vscode-nim/subscription","commits_url":"https://api.github.com/repos/pragmagic/vscode-nim/commits{/sha}","git_commits_url":"https://api.github.com/repos/pragmagic/vscode-nim/git/commits{/sha}","comments_url":"https://api.github.com/repos/pragmagic/vscode-nim/comments{/number}","issue_comment_url":"https://api.github.com/repos/pragmagic/vscode-nim/issues/comments{/number}","contents_url":"https://api.github.com/repos/pragmagic/vscode-nim/contents/{+path}","compare_url":"https://api.github.com/repos/pragmagic/vscode-nim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pragmagic/vscode-nim/merges","archive_url":"https://api.github.com/repos/pragmagic/vscode-nim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pragmagic/vscode-nim/downloads","issues_url":"https://api.github.com/repos/pragmagic/vscode-nim/issues{/number}","pulls_url":"https://api.github.com/repos/pragmagic/vscode-nim/pulls{/number}","milestones_url":"https://api.github.com/repos/pragmagic/vscode-nim/milestones{/number}","notifications_url":"https://api.github.com/repos/pragmagic/vscode-nim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pragmagic/vscode-nim/labels{/name}","releases_url":"https://api.github.com/repos/pragmagic/vscode-nim/releases{/id}","deployments_url":"https://api.github.com/repos/pragmagic/vscode-nim/deployments","created_at":"2016-02-15T12:24:14Z","updated_at":"2017-05-10T19:49:53Z","pushed_at":"2017-06-04T17:08:38Z","git_url":"git://github.com/pragmagic/vscode-nim.git","ssh_url":"git@github.com:pragmagic/vscode-nim.git","clone_url":"https://github.com/pragmagic/vscode-nim.git","svn_url":"https://github.com/pragmagic/vscode-nim","homepage":null,"size":166,"stargazers_count":44,"watchers_count":44,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":9,"forks":6,"open_issues":9,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52"},"html":{"href":"https://github.com/pragmagic/vscode-nim/pull/52"},"issue":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/issues/52"},"comments":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/pragmagic/vscode-nim/statuses/1d328ad61a4f314839764ccdb3d43e48c0e05978"}}}}
{"actor":{"display_login":"kosz78"}}