Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file.mkdir does not create intermediate directories any more #1764

Open
ssaarinen opened this issue Jun 30, 2023 · 0 comments
Open

file.mkdir does not create intermediate directories any more #1764

ssaarinen opened this issue Jun 30, 2023 · 0 comments

Comments

@ssaarinen
Copy link

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

file.mkdir(path.dirname(filepath));

which still states that it does this (like mkdir -p)

// 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.

purple-claw pushed a commit to purple-claw/grunt that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant