{"action":"created","issue":{"url":"https://api.github.com/repos/creationix/nvm/issues/765","labels_url":"https://api.github.com/repos/creationix/nvm/issues/765/labels{/name}","comments_url":"https://api.github.com/repos/creationix/nvm/issues/765/comments","events_url":"https://api.github.com/repos/creationix/nvm/issues/765/events","html_url":"https://github.com/creationix/nvm/pull/765","id":87788758,"number":765,"title":"Detect shell type from $SHELL variable instead of .$SHELLrc files","user":{"login":"CristianCantoro","id":367272,"avatar_url":"https://avatars.githubusercontent.com/u/367272?v=3","gravatar_id":"","url":"https://api.github.com/users/CristianCantoro","html_url":"https://github.com/CristianCantoro","followers_url":"https://api.github.com/users/CristianCantoro/followers","following_url":"https://api.github.com/users/CristianCantoro/following{/other_user}","gists_url":"https://api.github.com/users/CristianCantoro/gists{/gist_id}","starred_url":"https://api.github.com/users/CristianCantoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CristianCantoro/subscriptions","organizations_url":"https://api.github.com/users/CristianCantoro/orgs","repos_url":"https://api.github.com/users/CristianCantoro/repos","events_url":"https://api.github.com/users/CristianCantoro/events{/privacy}","received_events_url":"https://api.github.com/users/CristianCantoro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/creationix/nvm/labels/installing:%20profile%20detection","name":"installing: profile detection","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-06-12T17:00:05Z","updated_at":"2015-07-18T23:49:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/creationix/nvm/pulls/765","html_url":"https://github.com/creationix/nvm/pull/765","diff_url":"https://github.com/creationix/nvm/pull/765.diff","patch_url":"https://github.com/creationix/nvm/pull/765.patch"},"body":"As per commit message.\r\nI am using zsh on Ubuntu, but I am keeping also the default `.bashrc` that gets shipped with Ubuntu in my home folder. As of now, the nvm \"loading\" configuration gets added to `$HOME/.bashrc` because the check on `.bashrc` is encountered before the check on `.zshrc`.\r\n\r\n`basename` is part of the GNU coreutils so it should be widely available and this should work also on other OSes.\r\n\r\n## Testing the various shells\r\n(`sh` is `dash` on my system)\r\n\r\n### Launch from zsh\r\n```\r\n[~/extra/nvm/nvm]$ cat ./install.sh | sh\r\n=> Downloading nvm from git to '/home/cristian/.nvm'\r\n=> Cloning into '/home/cristian/.nvm'...\r\nremote: Counting objects: 3693, done.\r\nremote: Total 3693 (delta 0), reused 0 (delta 0), pack-reused 3693\r\nReceiving objects: 100% (3693/3693), 827.00 KiB | 0 bytes/s, done.\r\nResolving deltas: 100% (2132/2132), done.\r\nChecking connectivity... done.\r\n* (detached from v0.25.4)\r\n\r\n=> Appending source string to /home/cristian/.zshrc\r\n=> Close and reopen your terminal to start using nvm\r\n```\r\n\r\n### Launch from bash\r\n```\r\n$ bash\r\ncristian@wash:~/extra/nvm/nvm$ cat ./install.sh | sh\r\n=> Downloading nvm from git to '/home/cristian/.nvm'\r\n=> Cloning into '/home/cristian/.nvm'...\r\nremote: Counting objects: 3693, done.\r\nremote: Total 3693 (delta 0), reused 0 (delta 0), pack-reused 3693\r\nReceiving objects: 100% (3693/3693), 827.00 KiB | 0 bytes/s, done.\r\nResolving deltas: 100% (2132/2132), done.\r\nChecking connectivity... done.\r\n* (detached from v0.25.4)\r\n\r\n=> Source string already in /home/cristian/.zshrc\r\n=> Close and reopen your terminal to start using nvm\r\n```\r\n\r\n### Launch from ksh\r\n```\r\n$ ksh\r\n$ cat ./install.sh | sh\r\n=> Downloading nvm from git to '/home/cristian/.nvm'\r\n=> Cloning into '/home/cristian/.nvm'...\r\nremote: Counting objects: 3693, done.\r\nremote: Total 3693 (delta 0), reused 0 (delta 0), pack-reused 3693\r\nReceiving objects: 100% (3693/3693), 827.00 KiB | 1.41 MiB/s, done.\r\nResolving deltas: 100% (2132/2132), done.\r\nChecking connectivity... done.\r\n* (detached from v0.25.4)\r\n\r\n=> Source string already in /home/cristian/.zshrc\r\n=> Close and reopen your terminal to start using nvm\r\n```\r\n\r\n### Launch from sh\r\n```\r\n$ sh\r\n$ cat ./install.sh | sh\r\n=> Downloading nvm from git to '/home/cristian/.nvm'\r\n=> Cloning into '/home/cristian/.nvm'...\r\nremote: Counting objects: 3693, done.\r\nremote: Total 3693 (delta 0), reused 0 (delta 0), pack-reused 3693\r\nReceiving objects: 100% (3693/3693), 827.00 KiB | 0 bytes/s, done.\r\nResolving deltas: 100% (2132/2132), done.\r\nChecking connectivity... done.\r\n* (detached from v0.25.4)\r\n  master\r\n\r\n=> Source string already in /home/cristian/.zshrc\r\n=> Close and reopen your terminal to start using nvm\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/creationix/nvm/issues/comments/122605397","html_url":"https://github.com/creationix/nvm/pull/765#issuecomment-122605397","issue_url":"https://api.github.com/repos/creationix/nvm/issues/765","id":122605397,"user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars.githubusercontent.com/u/45469?v=3","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T23:49:49Z","updated_at":"2015-07-18T23:49:49Z","body":"I'd be totally fine with two modes of profile detection, \"default\" and \"current\". We can do that in a separate PR tho."}}