reputationdefender / grunt-clean

grunt task to remove previously generated files and directories
MIT License
11 stars 6 forks source link

[MAJOR BUG] Wipes out entire project folder #11

Closed ericclemmons closed 11 years ago

ericclemmons commented 11 years ago

Since many grunt tasks are multitasks, I mistakenly had this structure:

clean:  {
  all:  {
      folder: '<%= dirs.build %>'
  }
}

As a result, the task removed all of [Object], which was stringified (I assume) as an empty string, effectively removing everything.

I created this issue so others don't suffer the same fate until it's fixed.

skiss9 commented 11 years ago

I think I ran into a similar issue. I tried to specify an array so it would clean two files, like so:

clean: {
    target: ['file1.js', 'file2.js']
}

That also wiped out half of the files in my project. Luckily I only lost 10 minutes of uncommitted work, but this is really dangerous!! If I specify only one file as a string it behaves normally. This should be fixed right away!!!