{"action":"created","issue":{"url":"https://api.github.com/repos/creationix/nvm/issues/1838","repository_url":"https://api.github.com/repos/creationix/nvm","labels_url":"https://api.github.com/repos/creationix/nvm/issues/1838/labels{/name}","comments_url":"https://api.github.com/repos/creationix/nvm/issues/1838/comments","events_url":"https://api.github.com/repos/creationix/nvm/issues/1838/events","html_url":"https://github.com/creationix/nvm/issues/1838","id":333027478,"node_id":"MDU6SXNzdWUzMzMwMjc0Nzg=","number":1838,"title":"Default .bash_profile script improvements","user":{"login":"JBallin","id":8250797,"node_id":"MDQ6VXNlcjgyNTA3OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/8250797?v=4","gravatar_id":"","url":"https://api.github.com/users/JBallin","html_url":"https://github.com/JBallin","followers_url":"https://api.github.com/users/JBallin/followers","following_url":"https://api.github.com/users/JBallin/following{/other_user}","gists_url":"https://api.github.com/users/JBallin/gists{/gist_id}","starred_url":"https://api.github.com/users/JBallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JBallin/subscriptions","organizations_url":"https://api.github.com/users/JBallin/orgs","repos_url":"https://api.github.com/users/JBallin/repos","events_url":"https://api.github.com/users/JBallin/events{/privacy}","received_events_url":"https://api.github.com/users/JBallin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-17T01:32:38Z","updated_at":"2018-06-17T02:50:11Z","closed_at":null,"author_association":"NONE","body":"```\r\nexport NVM_DIR=\"$HOME/.nvm\"\r\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" # This loads nvm\r\n```\r\n\r\n1. Why use `\\.` to source files (vs `.`)? \r\n2. [Why check for the existence of the file](https://unix.stackexchange.com/questions/450239/why-check-for-file-existence-before-sourcing-it?noredirect=1#comment817343_450239) instead of just sourcing it - cleaner and throws an error if you don't have the file. \r\n3. Is the `export` [necessary](https://unix.stackexchange.com/a/107853/273817)?\r\n\r\n_I also don't like how nvm is loaded on startup every time, but that's been covered in other issues._\r\n\r\nFor reference, here is my [current script](https://gist.github.com/JBallin/17758cfed06e7415209ce3335490745b)."},"comment":{"url":"https://api.github.com/repos/creationix/nvm/issues/comments/397850926","html_url":"https://github.com/creationix/nvm/issues/1838#issuecomment-397850926","issue_url":"https://api.github.com/repos/creationix/nvm/issues/1838","id":397850926,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzg1MDkyNg==","user":{"login":"ljharb","id":45469,"node_id":"MDQ6VXNlcjQ1NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/45469?v=4","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":"2018-06-17T02:50:11Z","updated_at":"2018-06-17T02:50:11Z","author_association":"COLLABORATOR","body":"> Why use \\. to source files (vs .)?\r\n\r\nBecause some people may have aliased the `.` - see #1278.\r\n\r\n> Why check for the existence of the file instead of just sourcing it - cleaner and throws an error if you don't have the file.\r\n\r\nBecause you should be able to delete the file, not be forced to clean up your profile files, and still not see an error.\r\n\r\n> Is the export necessary?\r\n\r\nwhich export did you have in mind? People might be sourcing `nvm.sh` multiple times, so for example, `NVM_DIR` is exported to be shared across those.\r\n\r\nAs for being loaded on startup every time, if you load with `--no-use`, it will not be slow, so I'm not sure why else you wouldn't like it being loaded on startup."}}
{"actor":{"display_login":"ljharb"}}