{"action":"created","issue":{"url":"https://api.github.com/repos/shelljs/shelljs/issues/832","repository_url":"https://api.github.com/repos/shelljs/shelljs","labels_url":"https://api.github.com/repos/shelljs/shelljs/issues/832/labels{/name}","comments_url":"https://api.github.com/repos/shelljs/shelljs/issues/832/comments","events_url":"https://api.github.com/repos/shelljs/shelljs/issues/832/events","html_url":"https://github.com/shelljs/shelljs/issues/832","id":311518490,"number":832,"title":"Symlinking into a directory does not work","user":{"login":"Loilo","id":1922624,"avatar_url":"https://avatars3.githubusercontent.com/u/1922624?v=4","gravatar_id":"","url":"https://api.github.com/users/Loilo","html_url":"https://github.com/Loilo","followers_url":"https://api.github.com/users/Loilo/followers","following_url":"https://api.github.com/users/Loilo/following{/other_user}","gists_url":"https://api.github.com/users/Loilo/gists{/gist_id}","starred_url":"https://api.github.com/users/Loilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Loilo/subscriptions","organizations_url":"https://api.github.com/users/Loilo/orgs","repos_url":"https://api.github.com/users/Loilo/repos","events_url":"https://api.github.com/users/Loilo/events{/privacy}","received_events_url":"https://api.github.com/users/Loilo/received_events","type":"User","site_admin":false},"labels":[{"id":309143754,"url":"https://api.github.com/repos/shelljs/shelljs/labels/fix","name":"fix","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-05T08:34:28Z","updated_at":"2018-04-05T23:13:28Z","closed_at":null,"author_association":"NONE","body":"### Node version:\r\n9.10.1\r\n\r\n### ShellJS version:\r\n0.7.8\r\n\r\n### Operating system:\r\nTested on **macOS 10.13.2** and **Ubuntu 14.04.5 LTS**\r\n\r\n### Description of the bug:\r\nIf the destination of the `ln` command is an existing directory, `shelljs` will fail stating that the `Destination file exists`.\r\n\r\nHowever, according to tests in the mentioned environments, the correct behaviour would be to put a symlink with the source's name *into* that destination directory.\r\n\r\n### Example ShellJS command to reproduce the error:\r\n\r\nThe following commands fail, they should instead create a symlink to `/some/source/path` as `./path`.\r\n\r\n```javascript\r\nshelljs.ln('-s', '/some/source/path', '.')\r\n```\r\n\r\nor\r\n\r\n```bash\r\nshx ln -s /some/source/path .\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/shelljs/shelljs/issues/comments/379103713","html_url":"https://github.com/shelljs/shelljs/issues/832#issuecomment-379103713","issue_url":"https://api.github.com/repos/shelljs/shelljs/issues/832","id":379103713,"user":{"login":"Loilo","id":1922624,"avatar_url":"https://avatars3.githubusercontent.com/u/1922624?v=4","gravatar_id":"","url":"https://api.github.com/users/Loilo","html_url":"https://github.com/Loilo","followers_url":"https://api.github.com/users/Loilo/followers","following_url":"https://api.github.com/users/Loilo/following{/other_user}","gists_url":"https://api.github.com/users/Loilo/gists{/gist_id}","starred_url":"https://api.github.com/users/Loilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Loilo/subscriptions","organizations_url":"https://api.github.com/users/Loilo/orgs","repos_url":"https://api.github.com/users/Loilo/repos","events_url":"https://api.github.com/users/Loilo/events{/privacy}","received_events_url":"https://api.github.com/users/Loilo/received_events","type":"User","site_admin":false},"created_at":"2018-04-05T23:13:28Z","updated_at":"2018-04-05T23:13:28Z","author_association":"NONE","body":"Yep, that's pretty much what I described.\r\n\r\nOne thing to mention though (which I figured out while implementing the attached pull request): The name in fact does *not* default to the source pointed to, but the basename you provided.\r\n\r\nBy Example:\r\n\r\nAssume the following directory tree:\r\n```\r\na/\r\n└── b/\r\n    └── c/\r\n```\r\n\r\nIf we are in `c/` and run `ln -s . ../..`, we'd expect to get a symlink named `c`, located inside `a`, pointing to `c`.\r\n\r\nThis is, in fact, not the case. The command will fail with `ln: failed to create symbolic link '../../.': File exists`.\r\n\r\nThat leads me to assume that the default name is actually the basename from the user-provided source path."}}
{"actor":{"display_login":"Loilo"}}