-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Stumbled on this while upgrading an old build to newer grunt version. There is a plugin (grunt-ng-constant) that uses grunt.file.write and expects the intermediate directories to be created if they do not exist.
file.write still calls file.mkdir
Line 271 in 238df78
| file.mkdir(path.dirname(filepath)); |
which still states that it does this (like mkdir -p)
Line 178 in 238df78
| // Like mkdir -p. Create a directory and any intermediary directories. |
But infact it does not and build fails (on 1.6.1) with
Warning: Unable to create directory "src/js" (Error code: EEXIST). if directory exists or ENOENT if it does not (and the hierarchy is more than 1 level, if i'm not not mistaken)
This works as expected w/ 1.5.3 (1.6.0 shows some syntax error)
API docs for file.write still state that
Write the specified contents to a file, creating intermediate directories if necessary.