-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgulpfile.js
36 lines (30 loc) · 849 Bytes
/
gulpfile.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
31
32
33
34
35
'use strict';
var gulp = require('gulp');
var through = require('through2');
var clone = require('gh-clone');
var del = require('delete');
var File = require('vinyl');
var copy = require('copy');
gulp.task('del', function(cb) {
del(['vendor', 'templates'], function(err) {
if (err) return cb(err);
gulp.start(['copy'], cb);
});
});
gulp.task('clone', function(cb) {
clone({repo: 'github/gitignore', dest: 'vendor'}, cb);
});
gulp.task('copy', ['clone'], function(cb) {
return gulp.src('vendor/**/*.gitignore')
.pipe(through.obj(function(file, enc, next) {
next(null, file);
}, function(next) {
this.push(new File({
path: 'Minimal.gitignore',
contents: new Buffer('node_modules\ncoverage')
}));
next();
}))
.pipe(gulp.dest('templates'))
});
gulp.task('default', ['del']);