Skip to content

Commit

Permalink
Fixed Issue gruntjs#1764
Browse files Browse the repository at this point in the history
  • Loading branch information
Nithin-SRI committed May 9, 2024
1 parent e1bb073 commit 82bf28d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/grunt/file.js
Expand Up @@ -268,7 +268,9 @@ file.write = function(filepath, contents, options) {
var nowrite = grunt.option('no-write');
grunt.verbose.write((nowrite ? 'Not actually writing ' : 'Writing ') + filepath + '...');
// Create path, if necessary.
file.mkdir(path.dirname(filepath));
if (!file.exists(path.dirname(filepath))) {
file.mkdir(path.dirname(filepath));
}
try {
// If contents is already a Buffer, don't try to encode it. If no encoding
// was specified, use the default.
Expand Down

0 comments on commit 82bf28d

Please sign in to comment.