- Voici le README et des exemples: https://github.com/gruntjs/grunt-contrib-copy/blob/master/README.md .
- Voici la partie pertinente du code (que je ne peux apparemment pas comprendre) de https://github.com/gruntjs/grunt-contrib-copy/blob/master/tasks/copy.js :
module.exports = fonction (grognement) { 'use strict'; var chemin = require ('chemin'); grunt.registerMultiTask ('copier', 'Copier les fichiers.', function () { var kindOf = grunt.util.kindOf; var options = this.options ({ processContent: faux, processContentExclude: [] }); var copyOptions = { processus: options.processContent, noProcess: options.processContentExclude }; grunt.verbose.writeflags (options, 'Options'); var dest; var isExpandedPair; var tally = { dirs: 0, fichiers: 0 }; this.files.forEach (fonction (filePair) { isExpandedPair = filePair.orig.expand || faux; filePair.src.forEach (fonction (src) { if (detectDestType (filePair.dest) === 'répertoire') { dest = (isExpandedPair)? filePair.dest: unixifyPath (chemin.join (filePair.dest, src)); } autre { dest = filePair.dest; } if (grunt.file.isDir (src)) { grunt.verbose.writeln ('Création' + dest.cyan); grunt.file.mkdir (dest); tally.dirs ++; } autre { grunt.verbose.writeln ('Copie' + src.cyan + '->' + dest.cyan); grunt.file.copy (src, dest, copyOptions); tally.files ++; } }); });