jsdoc3/jsdoc — pull request #492 by eventualbuddha (2013-09-17 18:40:47+00:00)
Title: Account for relative jsdoc symlinks.

This happens when you install jsdoc via homebrew on Mac OS X. The jsdoc binary is actually a link to "../Cellar/jsdoc3/3.2.0/bin/jsdoc", which without this patch the BASEPATH line below tries to cd up a level from the current working directory and into a non-existent Cellar directory.

To reproduce, run `brew install jsdoc` followed by `jsdoc --help`. You'll get an error message like this:

```
$ jsdoc --help
/usr/local/bin/jsdoc: line 7: cd: ../Cellar/jsdoc3/3.2.0/bin: No such file or directory
Error: Could not find or load main class org.mozilla.javascript.tools.shell.Main
```