Skip to content

Instantly share code, notes, and snippets.

@felixzapata
Created October 25, 2013 18:29
Show Gist options
  • Save felixzapata/7159513 to your computer and use it in GitHub Desktop.
Save felixzapata/7159513 to your computer and use it in GitHub Desktop.
tarea copiar dentro de Grunt
/*
* grunt-copy-all-docs
*
*/
'use strict';
module.exports = function(grunt) {
var fs = require('fs'),
ncp = require('ncp').ncp,
path = require('path');
// Please see the Grunt documentation for more information regarding task
// creation: http://gruntjs.com/creating-tasks
grunt.registerTask('copy_all_docs', 'Find and copy "Docs" directories.', function() {
var src = grunt.option('src');
if (typeof src === 'undefined') {
grunt.fail.fatal('No source path');
} else {
grunt.file.mkdir(path.normalize(path.join(__dirname, '../tasks2/docs/rp1')));
ncp(path.normalize(__dirname + '/test/fixtures/repos/rp1/docs/*'), '../tasks2/docs/rp1', function(err) {
if (err) {
return console.error(err);
}
console.log('done!');
});
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment