taptapship/wiredep — pull request #81 by jcdenton (2014-07-01 11:54:13+00:00)
Title: Issue with `include-self` paths

When using `include-self` wiredep always consideres main file paths a relative to `process.cwd()`, so when using `bower.json` from some other `cwd`, it injects invalid paths.
For example, we have the following directory structure:
```
Gruntfile.js
src/
app/
app.js
index.html
stage/
app/
app.js
bower.json
bower_components
index.html
```

`Gruntfile.js` contains:
```
wiredep: {
stage: {
cwd: 'stage',
src: 'stage/index.html',
includeSelf: true
}
}
```

`bower.json` contains:
```
"main": [
"app/app.js"
]
```

While `bower_components` scripts are injected correctly, self mains are injected as if they are in the root dir, not in `stage`: ``
What do I expect to have: ``

Plus there is `--mainFileDirectory` argument in the `readme.md`, though there isn't any logic for actually processing it, I've also fixed this.