creationix/nvm — pull request #358 by drkibitz (2014-02-16 06:31:05+00:00)
Title: Use symlinks for aliases

This is something I've seen mentioned in another issue, and something that would greatly simplify my own CI setup, and allow me to use nvm in more versatile ways.

I didn't try for backwards compatibility, so yes these are indeed breaking changes. If this is rejected I won't bother, but if you are interested in merging, but want backwards compatibility, then I have another idea of using symlinks in addition to files.

One thing to note is why I am removing the link if it exists before creating it instead of just using `ln -f`. This is because (on OS X at least) if you `ln -sf path/to/dir existing/link/to/old/dir` then it creates a link to inside of `existing/link/to/old/dir`. This essentially gives you `existing/link/to/old/dir/dir`, which points to nothing if `path/to/dir` is relative.

---

This is my first contribution to nvm so wanted to note a few of issues I came across. These are not related to this pull request:
- `nvm deactivate` fails in OS X Mavericks, and fails test of course (might be if PATH is set by launchd).
- Not sure what is the preferred shell compatibility nvm is going for. It looks to be bash, but there's many inconsistencies between using bash only things versus sh compatible things.
- There are quite a few variables not declared as local (ALIAS being one of them).

If you are interested in further pull requests for these, please let me know.