{"action":"opened","number":421,"pull_request":{"url":"https://api.github.com/repos/shelljs/shelljs/pulls/421","id":65407719,"html_url":"https://github.com/shelljs/shelljs/pull/421","diff_url":"https://github.com/shelljs/shelljs/pull/421.diff","patch_url":"https://github.com/shelljs/shelljs/pull/421.patch","issue_url":"https://api.github.com/repos/shelljs/shelljs/issues/421","number":421,"state":"open","locked":false,"title":"feat(cp): -P option, plus better handling of symlinks","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":"Fixes #413 \r\n\r\nOk, so this wound up being a bigger PR than I anticipated. I originally wanted to implement the `-P` option for `cp()`, but I realized that ShellJS didn't have very good semantics for handling links. So this PR fixes a variety of bugs surrounding behavior of links.\r\n\r\n - `rm('badlink')` used to not work, now it does\r\n - `cp('link', 'dest')` will follow the link\r\n - `cp('-R', 'link', 'dest')` will **not** follow the link (regardless of whether it points to a directory or not)\r\n - `cp('-P', 'link', 'dest')` will of course not follow the link (regardless of whether or not `-R` is used)\r\n - `touch('badlink')` creates the file it points to (as `touch` should)\r\n - `mkdir('badlink')` outputs an error message instead of crashing\r\n - copying a directory that has links within it works properly (used to break)","created_at":"2016-04-06T04:12:08Z","updated_at":"2016-04-06T04:12:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"ariporad","id":1817508,"avatar_url":"https://avatars.githubusercontent.com/u/1817508?v=3","gravatar_id":"","url":"https://api.github.com/users/ariporad","html_url":"https://github.com/ariporad","followers_url":"https://api.github.com/users/ariporad/followers","following_url":"https://api.github.com/users/ariporad/following{/other_user}","gists_url":"https://api.github.com/users/ariporad/gists{/gist_id}","starred_url":"https://api.github.com/users/ariporad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariporad/subscriptions","organizations_url":"https://api.github.com/users/ariporad/orgs","repos_url":"https://api.github.com/users/ariporad/repos","events_url":"https://api.github.com/users/ariporad/events{/privacy}","received_events_url":"https://api.github.com/users/ariporad/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/shelljs/shelljs/milestones/3","html_url":"https://github.com/shelljs/shelljs/milestones/v0.7.0","labels_url":"https://api.github.com/repos/shelljs/shelljs/milestones/3/labels","id":1555794,"number":3,"title":"v0.7.0","description":"","creator":{"login":"ariporad","id":1817508,"avatar_url":"https://avatars.githubusercontent.com/u/1817508?v=3","gravatar_id":"","url":"https://api.github.com/users/ariporad","html_url":"https://github.com/ariporad","followers_url":"https://api.github.com/users/ariporad/followers","following_url":"https://api.github.com/users/ariporad/following{/other_user}","gists_url":"https://api.github.com/users/ariporad/gists{/gist_id}","starred_url":"https://api.github.com/users/ariporad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariporad/subscriptions","organizations_url":"https://api.github.com/users/ariporad/orgs","repos_url":"https://api.github.com/users/ariporad/repos","events_url":"https://api.github.com/users/ariporad/events{/privacy}","received_events_url":"https://api.github.com/users/ariporad/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":50,"state":"open","created_at":"2016-02-01T14:48:26Z","updated_at":"2016-04-06T04:12:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/shelljs/shelljs/pulls/421/commits","review_comments_url":"https://api.github.com/repos/shelljs/shelljs/pulls/421/comments","review_comment_url":"https://api.github.com/repos/shelljs/shelljs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shelljs/shelljs/issues/421/comments","statuses_url":"https://api.github.com/repos/shelljs/shelljs/statuses/ec54e6758578a552da143f21303130f49960fd2d","head":{"label":"shelljs:feat-cp-p-option","ref":"feat-cp-p-option","sha":"ec54e6758578a552da143f21303130f49960fd2d","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-04-06T01:42:00Z","pushed_at":"2016-04-06T03:37:42Z","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":785,"stargazers_count":3985,"watchers_count":3985,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":258,"mirror_url":null,"open_issues_count":62,"forks":258,"open_issues":62,"watchers":3985,"default_branch":"master"}},"base":{"label":"shelljs:master","ref":"master","sha":"193efa7048d03db184ae3c27566b3a5f54699fdd","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-04-06T01:42:00Z","pushed_at":"2016-04-06T03:37:42Z","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":785,"stargazers_count":3985,"watchers_count":3985,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":258,"mirror_url":null,"open_issues_count":62,"forks":258,"open_issues":62,"watchers":3985,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/421"},"html":{"href":"https://github.com/shelljs/shelljs/pull/421"},"issue":{"href":"https://api.github.com/repos/shelljs/shelljs/issues/421"},"comments":{"href":"https://api.github.com/repos/shelljs/shelljs/issues/421/comments"},"review_comments":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/421/comments"},"review_comment":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shelljs/shelljs/pulls/421/commits"},"statuses":{"href":"https://api.github.com/repos/shelljs/shelljs/statuses/ec54e6758578a552da143f21303130f49960fd2d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":181,"deletions":38,"changed_files":16}}