cowboy/grunt — Issue #63: Process templates when expanding config
Author: jzaefferer
Created: 2012-03-08 15:17:57+00:00
State: open

Somewhat related to the fix for #62 - I've got this on my config:

config.init({
pkg: '',
files: {
distFolder: 'dist/<%= pkg.name %>-<%= pkg.version %>',
cdnDistFolder: 'dist/<%= pkg.name %>-<%= pkg.version %>-cdn',
zip: 'dist/<%= pkg.name %>-<%= pkg.version %>.zip',
cdnZip: 'dist/<%= pkg.name %>-<%= pkg.version %>-cdn.zip'
}

Currently I have to expand that manually...

var files = config().files;
for (var key in files) {
files[key] = template.process(files[key], config());
}
config(

...in order to acccess the processed results from other config properties:

zip: {
dist: {
src: '<%= files.distFolder %>/**/*',
dest: '<%= files.zip %>'
},
cdn: {
src: '<%= files.cdnDistFolder %>/**/*',
dest: '<%= files.cdnZip %>'
}
}

Or is there a better way to get the same result? The idea is to not repeat certain paths again and again...