Use grunt function to detect directory

Hello,

After finding out that task wasn't working for some of the colleagues using windows (yeah I know) when copying to directories, I fixed it by using grunt function to detect whether path is pointing to directory or a file. This made everyone's day better. ;) Would you mind pulling this patch so we can switch back to official npm repo?

Cheers,
Dali