{"action":"opened","number":330,"pull_request":{"url":"https://api.github.com/repos/shelljs/shelljs/pulls/330","id":57795312,"html_url":"https://github.com/shelljs/shelljs/pull/330","diff_url":"https://github.com/shelljs/shelljs/pull/330.diff","patch_url":"https://github.com/shelljs/shelljs/pull/330.patch","issue_url":"https://api.github.com/repos/shelljs/shelljs/issues/330","number":330,"state":"open","locked":false,"title":"Use bash by default for exec(), if it's available.","user":{"login":"nfischer","id":5801521,"avatar_url":"https://avatars.githubusercontent.com/u/5801521?v=3","gravatar_id":"","url":"https://api.github.com/users/nfischer","html_url":"https://github.com/nfischer","followers_url":"https://api.github.com/users/nfischer/followers","following_url":"https://api.github.com/users/nfischer/following{/other_user}","gists_url":"https://api.github.com/users/nfischer/gists{/gist_id}","starred_url":"https://api.github.com/users/nfischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfischer/subscriptions","organizations_url":"https://api.github.com/users/nfischer/orgs","repos_url":"https://api.github.com/users/nfischer/repos","events_url":"https://api.github.com/users/nfischer/events{/privacy}","received_events_url":"https://api.github.com/users/nfischer/received_events","type":"User","site_admin":false},"body":"This fixes #281. This uses `which()` to check for the existence of an executable named `bash`. If it exists, it adds this to the `shell` option of `exec()` and `execSync()`, otherwise it leaves this blank. This should work for Windows users that have bash installed. The previous behavior was to use `sh` by default on unix, and `cmd.exe` on Windows.\r\n\r\nTo test this, you can execute:\r\n\r\n```Javascript\r\nexec('echo $0'); // outputs the path of the shell, reliably\r\n```","created_at":"2016-02-01T04:17:28Z","updated_at":"2016-02-01T04:17:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shelljs/shelljs/pulls/330/commits","review_comments_url":"https://api.github.com/repos/shelljs/shelljs/pulls/330/comments","review_comment_url":"https://api.github.com/repos/shelljs/shelljs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shelljs/shelljs/issues/330/comments","statuses_url":"https://api.github.com/repos/shelljs/shelljs/statuses/ca6c4d5564be2d85412f0b8d1eb17228946efb57","head":{"label":"shelljs:bash-by-default","ref":"bash-by-default","sha":"ca6c4d5564be2d85412f0b8d1eb17228946efb57","user":{"login":"shelljs","id":14236201,"avatar_url":"https://avatars.githubusercontent.com/u/14236201?v=3","gravatar_id":"","url":"https://api.github.com/users/shelljs","html_url":"https://github.com/shelljs","followers_url":"https://api.github.com/users/shelljs/followers","following_url":"https://api.github.com/users/shelljs/following{/other_user}","gists_url":"https://api.github.com/users/shelljs/gists{/gist_id}","starred_url":"https://api.github.com/users/shelljs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelljs/subscriptions","organizations_url":"https://api.github.com/users/shelljs/orgs","repos_url":"https://api.github.com/users/shelljs/repos","events_url":"https://api.github.com/users/shelljs/events{/privacy}","received_events_url":"https://api.github.com/users/shelljs/received_events","type":"Organization","site_admin":false},"repo":{"id":3604157,"name":"shelljs","full_name":"shelljs/shelljs","owner":{"login":"shelljs","id":14236201,"avatar_url":"https://avatars.githubusercontent.com/u/14236201?v=3","gravatar_id":"","url":"https://api.github.com/users/shelljs","html_url":"https://github.com/shelljs","followers_url":"https://api.github.com/users/shelljs/followers","following_url":"https://api.github.com/users/shelljs/following{/other_user}","gists_url":"https://api.github.com/users/shelljs/gists{/gist_id}","starred_url":"https://api.github.com/users/shelljs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelljs/subscriptions","organizations_url":"https://api.github.com/users/shelljs/orgs","repos_url":"https://api.github.com/users/shelljs/repos","events_url":"https://api.github.com/users/shelljs/events{/privacy}","received_events_url":"https://api.github.com/users/shelljs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shelljs/shelljs","description":"Portable Unix shell commands for Node.js","fork":false,"url":"https://api.github.com/repos/shelljs/shelljs","forks_url":"https://api.github.com/repos/shelljs/shelljs/forks","keys_url":"https://api.github.com/repos/shelljs/shelljs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shelljs/shelljs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shelljs/shelljs/teams","hooks_url":"https://api.github.com/repos/shelljs/shelljs/hooks","issue_events_url":"https://api.github.com/repos/shelljs/shelljs/issues/events{/number}","events_url":"https://api.github.com/repos/shelljs/shelljs/events","assignees_url":"https://api.github.com/repos/shelljs/shelljs/assignees{/user}","branches_url":"https://api.github.com/repos/shelljs/shelljs/branches{/branch}","tags_url":"https://api.github.com/repos/shelljs/shelljs/tags","blobs_url":"https://api.github.com/repos/shelljs/shelljs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shelljs/shelljs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shelljs/shelljs/git/refs{/sha}","trees_url":"https://api.github.com/repos/shelljs/shelljs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shelljs/shelljs/statuses/{sha}","languages_url":"https://api.github.com/repos/shelljs/shelljs/languages","stargazers_url":"https://api.github.com/repos/shelljs/shelljs/stargazers","contributors_url":"https://api.github.com/repos/shelljs/shelljs/contributors","subscribers_url":"https://api.github.com/repos/shelljs/shelljs/subscribers","subscription_url":"https://api.github.com/repos/shelljs/shelljs/subscription","commits_url":"https://api.github.com/repos/shelljs/shelljs/commits{/sha}","git_commits_url":"https://api.github.com/repos/shelljs/shelljs/git/commits{/sha}","comments_url":"https://api.github.com/repos/shelljs/shelljs/comments{/number}","issue_comment_url":"https://api.github.com/repos/shelljs/shelljs/issues/comments{/number}","contents_url":"https://api.github.com/repos/shelljs/shelljs/contents/{+path}","compare_url":"https://api.github.com/repos/shelljs/shelljs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shelljs/shelljs/merges","archive_url":"https://api.github.com/repos/shelljs/shelljs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shelljs/shelljs/downloads","issues_url":"https://api.github.com/repos/shelljs/shelljs/issues{/number}","pulls_url":"https://api.github.com/repos/shelljs/shelljs/pulls{/number}","milestones_url":"https://api.github.com/repos/shelljs/shelljs/milestones{/number}","notifications_url":"https://api.github.com/repos/shelljs/shelljs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shelljs/shelljs/labels{/name}","releases_url":"https://api.github.com/repos/shelljs/shelljs/releases{/id}","deployments_url":"https://api.github.com/repos/shelljs/shelljs/deployments","created_at":"2012-03-02T17:04:47Z","updated_at":"2016-01-31T21:09:26Z","pushed_at":"2016-02-01T04:13:52Z","git_url":"git://github.com/shelljs/shelljs.git","ssh_url":"git@github.com:shelljs/shelljs.git","clone_url":"https://github.com/shelljs/shelljs.git","svn_url":"https://github.com/shelljs/shelljs","homepage":"shelljs.org","size":643,"stargazers_count":3436,"watchers_count":3436,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":240,"mirror_url":null,"open_issues_count":90,"forks":240,"open_issues":90,"watchers":3436,"default_branch":"master"}},"base":{"label":"shelljs:master","ref":"master","sha":"b764c40e00310555d0a1f2827041eb109f749299","user":{"login":"shelljs","id":14236201,"avatar_url":"https://avatars.githubusercontent.com/u/14236201?v=3","gravatar_id":"","url":"https://api.github.com/users/shelljs","html_url":"https://github.com/shelljs","followers_url":"https://api.github.com/users/shelljs/followers","following_url":"https://api.github.com/users/shelljs/following{/other_user}","gists_url":"https://api.github.com/users/shelljs/gists{/gist_id}","starred_url":"https://api.github.com/users/shelljs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelljs/subscriptions","organizations_url":"https://api.github.com/users/shelljs/orgs","repos_url":"https://api.github.com/users/shelljs/repos","events_url":"https://api.github.com/users/shelljs/events{/privacy}","received_events_url":"https://api.github.com/users/shelljs/received_events","type":"Organization","site_admin":false},"repo":{"id":3604157,"name":"shelljs","full_name":"shelljs/shelljs","owner":{"login":"shelljs","id":14236201,"avatar_url":"https://avatars.githubusercontent.com/u/14236201?v=3","gravatar_id":"","url":"https://api.github.com/users/shelljs","html_url":"https://github.com/shelljs","followers_url":"https://api.github.com/users/shelljs/followers","following_url":"https://api.github.com/users/shelljs/following{/other_user}","gists_url":"https://api.github.com/users/shelljs/gists{/gist_id}","starred_url":"https://api.github.com/users/shelljs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelljs/subscriptions","organizations_url":"https://api.github.com/users/shelljs/orgs","repos_url":"https://api.github.com/users/shelljs/repos","events_url":"https://api.github.com/users/shelljs/events{/privacy}","received_events_url":"https://api.github.com/users/shelljs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shelljs/shelljs","description":"Portable Unix shell commands for Node.js","fork":false,"url":"https://api.github.com/repos/shelljs/shelljs","forks_url":"https://api.github.com/repos/shelljs/shelljs/forks","keys_url":"https://api.github.com/repos/shelljs/shelljs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shelljs/shelljs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shelljs/shelljs/teams","hooks_url":"https://api.github.com/repos/shelljs/shelljs/hooks","issue_events_url":"https://api.github.com/repos/shelljs/shelljs/issues/events{/number}","events_url":"https://api.github.com/repos/shelljs/shelljs/events","assignees_url":"https://api.github.com/repos/shelljs/shelljs/assignees{/user}","branches_url":"https://api.github.com/repos/shelljs/shelljs/branches{/branch}","tags_url":"https://api.github.com/repos/shelljs/shelljs/tags","blobs_url":"https://api.github.com/repos/shelljs/shelljs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shelljs/shelljs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shelljs/shelljs/git/refs{/sha}","trees_url":"https://api.github.com/repos/shelljs/shelljs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shelljs/shelljs/statuses/{sha}","languages_url":"https://api.github.com/repos/shelljs/shelljs/languages","stargazers_url":"https://api.github.com/repos/shelljs/shelljs/stargazers","contributors_url":"https://api.github.com/repos/shelljs/shelljs/contributors","subscribers_url":"https://api.github.com/repos/shelljs/shelljs/subscribers","subscription_url":"https://api.github.com/repos/shelljs/shelljs/subscription","commits_url":"https://api.github.com/repos/shelljs/shelljs/commits{/sha}","git_commits_url":"https://api.github.com/repos/shelljs/shelljs/git/commits{/sha}","comments_url":"https://api.github.com/repos/shelljs/shelljs/comments{/number}","issue_comment_url":"https://api.github.com/repos/shelljs/shelljs/issues/comments{/number}","contents_url":"https://api.github.com/repos/shelljs/shelljs/contents/{+path}","compare_url":"https://api.github.com/repos/shelljs/shelljs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shelljs/shelljs/merges","archive_url":"https://api.github.com/repos/shelljs/shelljs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shelljs/shelljs/downloads","issues_url":"https://api.github.com/repos/shelljs/shelljs/issues{/number}","pulls_url":"https://api.github.com/repos/shelljs/shelljs/pulls{/number}","milestones_url":"https://api.github.com/repos/shelljs/shelljs/milestones{/number}","notifications_url":"https://api.github.com/repos/shelljs/shelljs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shelljs/shelljs/labels{/name}","releases_url":"https://api.github.com/repos/shelljs/shelljs/releases{/id}","deployments_url":"https://api.github.com/repos/shelljs/shelljs/deployments","created_at":"2012-03-02T17:04:47Z","updated_at":"2016-01-31T21:09:26Z","pushed_at":"2016-02-01T04:13:52Z","git_url":"git://github.com/shelljs/shelljs.git","ssh_url":"git@github.com:shelljs/shelljs.git","clone_url":"https://github.com/shelljs/shelljs.git","svn_url":"https://github.com/shelljs/shelljs","homepage":"shelljs.org","size":643,"stargazers_count":3436,"watchers_count":3436,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":240,"mirror_url":null,"open_issues_count":90,"forks":240,"open_issues":90,"watchers":3436,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/330"},"html":{"href":"https://github.com/shelljs/shelljs/pull/330"},"issue":{"href":"https://api.github.com/repos/shelljs/shelljs/issues/330"},"comments":{"href":"https://api.github.com/repos/shelljs/shelljs/issues/330/comments"},"review_comments":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/330/comments"},"review_comment":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/330/commits"},"statuses":{"href":"https://api.github.com/repos/shelljs/shelljs/statuses/ca6c4d5564be2d85412f0b8d1eb17228946efb57"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":23,"deletions":4,"changed_files":1}}