Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt Concat cannot write to file

Tags:

gruntjs

Just installed latest Grunt on Ubuntu 12.04. Here is my gruntfile:

module.exports = function(grunt){ //project configuration grunt.initConfig({     pkg: grunt.file.readJSON('package.json'),      concat: {         slides :  {             src : ['src/top.html', 'src/bottom.html'],             dest : ['build/index.html']         }     } });  //enable plugins grunt.loadNpmTasks('grunt-contrib'); grunt.registerTask('default', ['concat:slides']); } 

This creates the build/ directory fine, but gives me the output of:

Running "concat:slides" (concat) task Warning: Unable to write "build/index.html" file (Error code: undefined). Use --force to continue.

I tried running chmod 777 on the directory, as I thought it might have something to do with permissions, but that didn't seem to change anything.

How can I make it so Grunt will write to build/index.html?

like image 807
Andrew Carreiro Avatar asked Mar 20 '13 04:03

Andrew Carreiro


1 Answers

Figured it out:

//Does not work dest : ['build/index.html'] 

Works as a string, but not an array:

//Works dest : 'build/index.html' 
like image 134
Andrew Carreiro Avatar answered Oct 04 '22 08:10

Andrew Carreiro