grunt.file.write calls grunt.file.mkdir internally, so calling mkdir externally is unnecessary.