{"action":"created","comment":{"url":"https://api.github.com/repos/bcoe/yargs/pulls/comments/28206044","id":28206044,"diff_hunk":"@@ -23,7 +23,7 @@ function Argv (processArgs, cwd) {\n         .map(function (x) {\n             // ignore the node bin, specify this in your\n             // bin file with #!/usr/bin/env node\n-            if (~x.indexOf('node') || ~x.indexOf('iojs')) return;\n+            if (/^(node|iojs)\\b/.test(x)) return;","path":"index.js","position":5,"original_position":5,"commit_id":"6302a6f05e7ace34b63e605e528f8cbad14304d9","original_commit_id":"6302a6f05e7ace34b63e605e528f8cbad14304d9","user":{"login":"bcoe","id":194609,"avatar_url":"https://avatars.githubusercontent.com/u/194609?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"body":"I'm pretty sure there are cases where the bin can be:\r\n\r\n`/usr/bin/node`, or `/user/bin/iojs`, perhaps we could modify the regex to something like:\r\n\r\n`/(node|iojs)$/`?","created_at":"2015-04-12T18:42:09Z","updated_at":"2015-04-12T18:42:09Z","html_url":"https://github.com/bcoe/yargs/pull/146#discussion_r28206044","pull_request_url":"https://api.github.com/repos/bcoe/yargs/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/bcoe/yargs/pulls/comments/28206044"},"html":{"href":"https://github.com/bcoe/yargs/pull/146#discussion_r28206044"},"pull_request":{"href":"https://api.github.com/repos/bcoe/yargs/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/bcoe/yargs/pulls/146","id":33119044,"html_url":"https://github.com/bcoe/yargs/pull/146","diff_url":"https://github.com/bcoe/yargs/pull/146.diff","patch_url":"https://github.com/bcoe/yargs/pull/146.patch","issue_url":"https://api.github.com/repos/bcoe/yargs/issues/146","number":146,"state":"open","locked":false,"title":"Fix $0 when 'node' or 'iojs' in script path","user":{"login":"nylen","id":227022,"avatar_url":"https://avatars.githubusercontent.com/u/227022?v=3","gravatar_id":"","url":"https://api.github.com/users/nylen","html_url":"https://github.com/nylen","followers_url":"https://api.github.com/users/nylen/followers","following_url":"https://api.github.com/users/nylen/following{/other_user}","gists_url":"https://api.github.com/users/nylen/gists{/gist_id}","starred_url":"https://api.github.com/users/nylen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nylen/subscriptions","organizations_url":"https://api.github.com/users/nylen/orgs","repos_url":"https://api.github.com/users/nylen/repos","events_url":"https://api.github.com/users/nylen/events{/privacy}","received_events_url":"https://api.github.com/users/nylen/received_events","type":"User","site_admin":false},"body":"This was causing `argv.$0` to be `''` for me since a lot of my code files live at `/somedir/node/projectname/file.js`.","created_at":"2015-04-12T12:14:23Z","updated_at":"2015-04-12T18:42:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ca23b2aee5dd7e67cf2a326e2020aa7a1503716","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bcoe/yargs/pulls/146/commits","review_comments_url":"https://api.github.com/repos/bcoe/yargs/pulls/146/comments","review_comment_url":"https://api.github.com/repos/bcoe/yargs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bcoe/yargs/issues/146/comments","statuses_url":"https://api.github.com/repos/bcoe/yargs/statuses/6302a6f05e7ace34b63e605e528f8cbad14304d9","head":{"label":"nylen:fix/node-in-dir","ref":"fix/node-in-dir","sha":"6302a6f05e7ace34b63e605e528f8cbad14304d9","user":{"login":"nylen","id":227022,"avatar_url":"https://avatars.githubusercontent.com/u/227022?v=3","gravatar_id":"","url":"https://api.github.com/users/nylen","html_url":"https://github.com/nylen","followers_url":"https://api.github.com/users/nylen/followers","following_url":"https://api.github.com/users/nylen/following{/other_user}","gists_url":"https://api.github.com/users/nylen/gists{/gist_id}","starred_url":"https://api.github.com/users/nylen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nylen/subscriptions","organizations_url":"https://api.github.com/users/nylen/orgs","repos_url":"https://api.github.com/users/nylen/repos","events_url":"https://api.github.com/users/nylen/events{/privacy}","received_events_url":"https://api.github.com/users/nylen/received_events","type":"User","site_admin":false},"repo":{"id":16877280,"name":"yargs","full_name":"nylen/yargs","owner":{"login":"nylen","id":227022,"avatar_url":"https://avatars.githubusercontent.com/u/227022?v=3","gravatar_id":"","url":"https://api.github.com/users/nylen","html_url":"https://github.com/nylen","followers_url":"https://api.github.com/users/nylen/followers","following_url":"https://api.github.com/users/nylen/following{/other_user}","gists_url":"https://api.github.com/users/nylen/gists{/gist_id}","starred_url":"https://api.github.com/users/nylen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nylen/subscriptions","organizations_url":"https://api.github.com/users/nylen/orgs","repos_url":"https://api.github.com/users/nylen/repos","events_url":"https://api.github.com/users/nylen/events{/privacy}","received_events_url":"https://api.github.com/users/nylen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nylen/yargs","description":"","fork":true,"url":"https://api.github.com/repos/nylen/yargs","forks_url":"https://api.github.com/repos/nylen/yargs/forks","keys_url":"https://api.github.com/repos/nylen/yargs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nylen/yargs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nylen/yargs/teams","hooks_url":"https://api.github.com/repos/nylen/yargs/hooks","issue_events_url":"https://api.github.com/repos/nylen/yargs/issues/events{/number}","events_url":"https://api.github.com/repos/nylen/yargs/events","assignees_url":"https://api.github.com/repos/nylen/yargs/assignees{/user}","branches_url":"https://api.github.com/repos/nylen/yargs/branches{/branch}","tags_url":"https://api.github.com/repos/nylen/yargs/tags","blobs_url":"https://api.github.com/repos/nylen/yargs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nylen/yargs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nylen/yargs/git/refs{/sha}","trees_url":"https://api.github.com/repos/nylen/yargs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nylen/yargs/statuses/{sha}","languages_url":"https://api.github.com/repos/nylen/yargs/languages","stargazers_url":"https://api.github.com/repos/nylen/yargs/stargazers","contributors_url":"https://api.github.com/repos/nylen/yargs/contributors","subscribers_url":"https://api.github.com/repos/nylen/yargs/subscribers","subscription_url":"https://api.github.com/repos/nylen/yargs/subscription","commits_url":"https://api.github.com/repos/nylen/yargs/commits{/sha}","git_commits_url":"https://api.github.com/repos/nylen/yargs/git/commits{/sha}","comments_url":"https://api.github.com/repos/nylen/yargs/comments{/number}","issue_comment_url":"https://api.github.com/repos/nylen/yargs/issues/comments{/number}","contents_url":"https://api.github.com/repos/nylen/yargs/contents/{+path}","compare_url":"https://api.github.com/repos/nylen/yargs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nylen/yargs/merges","archive_url":"https://api.github.com/repos/nylen/yargs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nylen/yargs/downloads","issues_url":"https://api.github.com/repos/nylen/yargs/issues{/number}","pulls_url":"https://api.github.com/repos/nylen/yargs/pulls{/number}","milestones_url":"https://api.github.com/repos/nylen/yargs/milestones{/number}","notifications_url":"https://api.github.com/repos/nylen/yargs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nylen/yargs/labels{/name}","releases_url":"https://api.github.com/repos/nylen/yargs/releases{/id}","created_at":"2014-02-16T03:10:36Z","updated_at":"2014-08-11T19:19:57Z","pushed_at":"2015-04-12T12:13:12Z","git_url":"git://github.com/nylen/yargs.git","ssh_url":"git@github.com:nylen/yargs.git","clone_url":"https://github.com/nylen/yargs.git","svn_url":"https://github.com/nylen/yargs","homepage":"","size":588,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"bcoe:master","ref":"master","sha":"1f2bf91590de6b3d37e647bc9690b3f59fcd3e63","user":{"login":"bcoe","id":194609,"avatar_url":"https://avatars.githubusercontent.com/u/194609?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"repo":{"id":14210523,"name":"yargs","full_name":"bcoe/yargs","owner":{"login":"bcoe","id":194609,"avatar_url":"https://avatars.githubusercontent.com/u/194609?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoe","html_url":"https://github.com/bcoe","followers_url":"https://api.github.com/users/bcoe/followers","following_url":"https://api.github.com/users/bcoe/following{/other_user}","gists_url":"https://api.github.com/users/bcoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoe/subscriptions","organizations_url":"https://api.github.com/users/bcoe/orgs","repos_url":"https://api.github.com/users/bcoe/repos","events_url":"https://api.github.com/users/bcoe/events{/privacy}","received_events_url":"https://api.github.com/users/bcoe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bcoe/yargs","description":" yargs the modern, pirate-themed successor to optimist.","fork":false,"url":"https://api.github.com/repos/bcoe/yargs","forks_url":"https://api.github.com/repos/bcoe/yargs/forks","keys_url":"https://api.github.com/repos/bcoe/yargs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bcoe/yargs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bcoe/yargs/teams","hooks_url":"https://api.github.com/repos/bcoe/yargs/hooks","issue_events_url":"https://api.github.com/repos/bcoe/yargs/issues/events{/number}","events_url":"https://api.github.com/repos/bcoe/yargs/events","assignees_url":"https://api.github.com/repos/bcoe/yargs/assignees{/user}","branches_url":"https://api.github.com/repos/bcoe/yargs/branches{/branch}","tags_url":"https://api.github.com/repos/bcoe/yargs/tags","blobs_url":"https://api.github.com/repos/bcoe/yargs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bcoe/yargs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bcoe/yargs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bcoe/yargs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bcoe/yargs/statuses/{sha}","languages_url":"https://api.github.com/repos/bcoe/yargs/languages","stargazers_url":"https://api.github.com/repos/bcoe/yargs/stargazers","contributors_url":"https://api.github.com/repos/bcoe/yargs/contributors","subscribers_url":"https://api.github.com/repos/bcoe/yargs/subscribers","subscription_url":"https://api.github.com/repos/bcoe/yargs/subscription","commits_url":"https://api.github.com/repos/bcoe/yargs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bcoe/yargs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bcoe/yargs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bcoe/yargs/issues/comments{/number}","contents_url":"https://api.github.com/repos/bcoe/yargs/contents/{+path}","compare_url":"https://api.github.com/repos/bcoe/yargs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bcoe/yargs/merges","archive_url":"https://api.github.com/repos/bcoe/yargs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bcoe/yargs/downloads","issues_url":"https://api.github.com/repos/bcoe/yargs/issues{/number}","pulls_url":"https://api.github.com/repos/bcoe/yargs/pulls{/number}","milestones_url":"https://api.github.com/repos/bcoe/yargs/milestones{/number}","notifications_url":"https://api.github.com/repos/bcoe/yargs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bcoe/yargs/labels{/name}","releases_url":"https://api.github.com/repos/bcoe/yargs/releases{/id}","created_at":"2013-11-07T17:25:51Z","updated_at":"2015-04-11T23:03:58Z","pushed_at":"2015-04-12T12:14:23Z","git_url":"git://github.com/bcoe/yargs.git","ssh_url":"git@github.com:bcoe/yargs.git","clone_url":"https://github.com/bcoe/yargs.git","svn_url":"https://github.com/bcoe/yargs","homepage":"https://www.npmjs.com/package/yargs","size":2151,"stargazers_count":580,"watchers_count":580,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":11,"forks":29,"open_issues":11,"watchers":580,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bcoe/yargs/pulls/146"},"html":{"href":"https://github.com/bcoe/yargs/pull/146"},"issue":{"href":"https://api.github.com/repos/bcoe/yargs/issues/146"},"comments":{"href":"https://api.github.com/repos/bcoe/yargs/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/bcoe/yargs/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/bcoe/yargs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bcoe/yargs/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/bcoe/yargs/statuses/6302a6f05e7ace34b63e605e528f8cbad14304d9"}}}}