reputation/grunt-clean — pull request #3 by hitsthings (2012-08-02 01:42:16+00:00)
Title: Update tasks/clean.js

I misunderstood the config structure and accidentally passed in a config like:

clean : {
output : { folder: 'path' },
otherDir : { folder: 'other/path' }
}

Since path.resolve([Object object]) => cwd, I ended up half-deleting my .git and had to manually reclone and patch my changes in.

This fix at least checks that you're passing in the correct data before deleting things.

Another good fix might be to check for '.git', '.hg', or maybe just any '.' folders and cancel the clean (maybe add a force: true option to override).

Anyway, that fix is more opinionated, so I didn't make it.
But at least this one will save people from cleaning things they didn't mean to. :)