gruntjs / grunt-init

Generate project scaffolding from a template.
http://gruntjs.com/project-scaffolding
MIT License
194 stars 59 forks source link

Control destpath #102

Open monolithed opened 8 years ago

monolithed commented 8 years ago

Actual

var files = init.filesToCopy(properties); // {  "foo.js": "project/root/foo.js" }

for (let file in files) {
    let to = path.join('MY_CUSTOM_DIRECTORY', file);
    let from = files[file];

    delete files[file];
    files[to] = from;
}

init.copyAndProcess(files, properties);

It's real pain to understand how it works.....

Expected

var files = init.filesToCopy(properties, { 
    dest: 'MY_CUSTOM_DIRECTORY' // or something else...
}); 
// {  "MY_CUSTOM_DIRECTORY/foo.js": "project/root/foo.js" }

init.copyAndProcess(files, properties);