grunt-update-json icon indicating copy to clipboard operation
grunt-update-json copied to clipboard

Pass current file to modifying function

Open skruppy opened this issue 8 years ago • 0 comments

It would be nice to be able to access the source path and destination path of the currently modified JSON. It seems currently not possible if you use globbing. Here is an example of what should be possible:

update_json: {
	foo: {
		files: [{
			expand: true,
			src: 'src/**/*.foo',
			dest: 'dst/',
			ext: '.bar',
		}],
		
		fields: {
			x: function(j, src, dst){
				return j.x = 'From '+src+' to '+dst;
			}
		}
	},
}

skruppy avatar Jan 06 '17 19:01 skruppy