-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntfile.js
30 lines (26 loc) · 909 Bytes
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = function (grunt) {
grunt.initConfig({
getAllReadMes: {
all: {
files: {
"subs.md": "node_modules/koa*/readme.md"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerMultiTask('getAllReadMes', 'Get all nested readme.md files', function () {
grunt.log.writeln('Get all nested readme.md files');
var file = this.files.pop();
var dest = file.dest;
var glob = file.orig.src[0];
var readmes = grunt.file.glob.sync(glob);
grunt.log.writeln("from %s to %s", glob, dest);
grunt.log.writeln(readmes);
var files = {};
files[dest] = readmes;
grunt.config('concat.readmes', {files: files});
grunt.task.run('concat:readmes');
});
grunt.registerTask('default', ['getAllReadMes']);
};