gruntjs / grunt

Grunt: The JavaScript Task Runner
http://gruntjs.com/
Other
12.27k stars 1.5k forks source link

Fixed Issue #1764 #1774

Open purple-claw opened 4 months ago

purple-claw commented 4 months ago

The file.mkdir function is trying to create a directory that already exists, which causing the EXIST error. This function is not checking whether if the directory exists before trying to create it.

So i Go through lot of time before finding a solution with a simple logic, I added a check before calling file.mkdir function

if (!file.exists(path.dirname(filepath))) { file.mkdir(path.dirname(filepath)); }

It first checks if the directory exists using the file.exists function. If the directory does not exist, then it creates the directory using the file.mkdir function.

Thanks for Raising this Issue Looking Forward to Help out more :)