vigetlabs/grunt-complexity — pull request #22 by roman01la (2014-04-13 00:40:21+00:00)
Title: Create output dir if doesn't exist

This PR brings an ability of writing reports to non-existing directory.

Assume a usual config:
```
complexity: {
client: {
src: 'scripts/**/*.js',
options: {
jsLintXML: 'complexity/client/report.xml',
maintainability: 100
}
}
```

In current implementation, if `complexity/client/` dir structure doesn't exist, the task will fail, because `fs.writeFileSync` has no functionality of creating directories before writing to file system.

In this PR I've used `fs-extra` module, which bring `fs.mkdirpSync` method, it's Node implementation of `mkdir -p`. This will create desired dir structure, so you don't need to create folders manually :blush: