file.copy (actually grunt-config-copy but it uses grunt.file.copy underneath). This is working fine for me but I'm excluding certain glob patterns. This exclusion results in some empty folders, and the folders are still copied to new set. Is there any way to exclude empty folders? Thanks, Raif
here is my grunt-task
copy: {
release: {
expand: true,
deleteEmptyFolders:true,
cwd:'<%= srcFolder %>',
src: ['**',
'!**/obj/**',
'!**/*.cs',
'!**/*.vb',
'!**/*.csproj',
'!**/*.csproj.*'
],
dest: '<%= destFolder %>',
filter: function(filepath) {
var val = !grunt.file.isDir(filepath) || require('fs').readdirSync(filepath).length > 0;
grunt.log.write(val);
return val
}
}
}
the log shows that there are some false values being returned but I still have several empty folders in my desFolder.