I am trying to create a custom init task for a personal template in Grunt .
These are the js that generate my new project after grunt init:mytemplate
exports.description = 'Try Grunt'; exports.warnOn = '*'; exports.template = function(grunt, init, done) { grunt.helper('prompt', {type: 'skin'}, [ grunt.helper('prompt_for', 'name', 'trygrunt'), grunt.helper('prompt_for', 'title', 'Im Trying GruntJS'), grunt.helper('prompt_for', 'author_name', 'Myself') ], function(err, props) { var files = init.filesToCopy(props); init.copyAndProcess(files, props); done(); }); };
Everything works fine: files and folders are correctly created or renamed from the root folder of a custom template based on rename.json info.
Question: how can I dynamically rename folders, not just files?
i.e.
{ "libs/name.js": "libs/{%= name %}.js" //this works fine "src/name": "src/{%= name %}" //this doesn't work }
source share