Commit Graph

104 Commits

Author SHA1 Message Date
Michael Martinez 49a8ec9560 Merge 11507c3f38 into be56ff3b2e 2015-02-07 20:51:05 +00:00
Jordan Harband 0f1f3ed29c v0.23.3 2015-02-02 20:26:00 -08:00
Jordan Harband 1eaf6b53e4 v0.23.2 2015-01-23 13:53:03 -08:00
Jordan Harband 8822bd719a v0.23.1 2015-01-23 02:08:36 -08:00
Jordan Harband 2d9494af45 Clarifying install messages, to help with #559 and https://github.com/creationix/nvm/issues/400#issuecomment-71043828 2015-01-22 10:21:04 -08:00
Jordan Harband 43a7d78693 v0.23.0 2015-01-19 22:15:06 -08:00
Michael Martinez 11507c3f38 Fixes bug where NVM init script is appended to the wrong startup file
The existence of .bashrc, .bash_profile or .zshrc doesn't prove that the file is the currently utilized startup file or that it is the only file sourced. Because the current code operates under this assumption, the code:

```bash
  export NVM_DIR="/Users/<USERNAME>/.nvm"
  [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
```
is getting appended to the wrong profile for zsh users.

1) `[ -d ~/.nvm ] && rm -rfv ~/.nvm `
2) Install Zsh via https://github.com/robbyrussell/oh-my-zsh
3) Run nvm install script with cURL.
4) Run `which nvm`. Observe it's not in `$PATH`
5) Open a new shell session. Observe the issue persists.

To fix this, the code in this PR checks:

- Is `$PROFILE` set? If so, echo it.
- What is the active shell that is executing this script? (the parent shell)
- If the shell is zsh, echo the zshrc file
- If the shell is bash:
	- Is it login or non-login? Echo the neccessary file
	- Is it interactive or non interactive? Echo the neccessary
	  file.

This logic should address the primary bug and also prevent future bugs.

Note: bash by default reads ~/.profile last so it makes sense to write to ~/.bashrc or ~/.bash_profile instead of ~/.profile

See: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

Passed Manual Tests:
  zsh
  bash from within script
  bash as default shell
  bash -l from within zsh
2015-01-15 01:35:36 -08:00
Jordan Harband 448bd38a55 v0.22.2 2015-01-14 15:44:40 -08:00
Jordan Harband bf794ff8da Consistently prefix builtins with `command` 2015-01-11 11:53:24 -08:00
Jordan Harband 0a142b7e7a v0.22.1 2015-01-10 19:43:36 -08:00
Jordan Harband 3fc82d6b2f Use `command sed` for people who alias `sed`.
Fixes #493.
2015-01-09 01:50:05 -08:00
Jordan Harband 8328741792 Removing an unnecessary `return $?` 2014-12-28 22:29:26 -08:00
Jordan Harband 8e45afb9f1 Move the version to a single location, nvm_latest_version. 2014-12-28 15:59:06 -08:00
Jordan Harband fd2fb24b03 Refactor `nvm_source` a bit. 2014-12-28 15:55:44 -08:00
Jordan Harband c91e8d0ba2 v0.22.0 2014-12-26 16:30:21 -08:00
Jordan Harband bef3a5ce3a v0.21.0 2014-12-22 12:03:33 -08:00
Jordan Harband b3178ca925 Add "--quiet" to git commands post-install.
Mentioned in #595.
2014-12-18 10:37:10 -08:00
Jordan Harband 8964cb46d3 v0.20.0 2014-11-29 11:23:16 -08:00
Jordan Harband 7bbcd3a977 v0.19.0 2014-11-23 14:49:38 -08:00
Jordan Harband 689c52c90d Install nvm-exec as well when installing via script.
Fixes #553.
2014-11-22 10:34:20 -08:00
Jordan Harband 5904d41b25 Fixing a bug in install_as_script, from 516e553093 2014-11-22 10:29:48 -08:00
Xavier Cambar 516e553093 Refactors NVM_SOURCE 2014-11-06 22:35:24 +01:00
Jordan Harband 5f5eb47f14 v0.18.0 2014-11-05 10:59:59 -08:00
Xavier Cambar b9f15b0ab0 Tests for PROFILE detection 2014-10-29 18:50:04 +01:00
Xavier Cambar 3cdec8e875 Testable install script
* wraps main code into a function
* EnvVar-based install start
* Clean environment after install
2014-10-28 11:44:01 +01:00
Jordan Harband 4748b3a236 v0.17.3 2014-10-20 15:48:49 -07:00
Jordan Harband f0471acbf5 v0.17.2 2014-09-29 14:32:44 -07:00
Jordan Harband 145da7eef8 v0.17.1 2014-09-26 23:22:56 -07:00
Jordan Harband 5ad00f13fa Suppress error messages in case there's no `master` branch.
Fixes #533.
2014-09-25 22:10:48 -07:00
Jordan Harband 53f9841c6c v0.17.0 2014-09-24 14:58:07 -07:00
Jordan Harband 4f081ce4be Collapsing some if/else conditions with elif 2014-09-23 23:48:31 -07:00
Jordan Harband db0051753a Compare shell variable contents with a sentinel. 2014-09-23 23:47:17 -07:00
Jordan Harband cf1110ecea Quote $NVM_DIR in commands 2014-09-23 23:46:23 -07:00
Jordan Harband 64de890d07 v0.16.1 2014-09-14 22:24:18 -07:00
Jordan Harband d1b6332bbe v0.16.0 2014-09-11 00:58:09 -07:00
Jordan Harband a7108e98f2 Make .bashrc be checked first on install.
From #511. Closes #320. Closes #268. Closes #334. Fixes #497. Relates to
2014-09-04 00:54:50 -07:00
Adrian Perez Heredia 825cb46969 Updated error message for missing profile file 2014-09-03 15:07:28 +02:00
Adrian Perez Heredia ab56ec6675 This patch adds support for terminal emulators. Without this it wont work on gnome-terminal on Ubuntu 2014-09-03 15:07:27 +02:00
Jordan Harband 9d96e4a6bf v0.15.0 2014-09-03 00:08:53 -07:00
Jordan Harband f9769e40dd v0.14.0 2014-08-27 00:49:30 -07:00
Jordan Harband 708ac80a55 Properly replace the -I curl option for the --server-response wget option. 2014-08-15 20:47:55 -07:00
Jordan Harband eef12cc2b3 v0.13.1 2014-08-08 11:48:54 -07:00
Jordan Harband 61709c1f97 v0.13.0 2014-08-02 19:24:39 -07:00
Jordan Harband 1d37af162a v0.12.2 2014-07-29 00:35:27 -07:00
Jordan Harband 68574cc7e8 v0.12.1 2014-07-24 14:07:26 -07:00
Jordan Harband f5643dc7ea v0.12.0 2014-07-23 01:15:14 -07:00
Fabian Jakobs ad71389dcc master branch might not exist
After a fresh install I was unable to run the installer again. It was breaking with the error

error: branch 'master' not found.

my fix makes sure that the installer continues after that.
2014-07-23 10:08:58 +02:00
Jordan Harband 200a9aa97e v0.11.2 2014-07-20 23:58:19 -07:00
Koen Punt 9c2127ce33 string replacement turns out not POSIX compliant 2014-07-18 16:21:20 +02:00
Jordan Harband 7a423b7bb4 v0.11.1 2014-07-18 01:48:46 -07:00