forked from gajus/contents
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
51 lines (41 loc) · 1.23 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var gulp = require('gulp'),
Server = require('karma').Server,
eslint = require('gulp-eslint'),
jsonfile = require('jsonfile'),
gitdown = require('gitdown');
gulp.task('lint', function () {
return gulp
.src(['./src/**/*.js','./tests/**/*.js'])
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('version', ['lint'], function () {
var pkg = jsonfile.readFileSync('./package.json'),
bower = jsonfile.readFileSync('./bower.json');
bower.name = pkg.name;
bower.description = pkg.description;
bower.keywords = pkg.keywords;
bower.license = pkg.license;
bower.authors = [pkg.author];
jsonfile.writeFileSync('./bower.json', bower);
});
gulp.task('gitdown', function () {
return gitdown
.read('./.gitdown/README.md')
.write('./README.md');
});
gulp.task('watch', function () {
gulp.watch(['./src/**/*', './tests/**/*'], ['default']);
gulp.watch(['./.gitdown/**/*'], ['gitdown']);
});
gulp.task('test', ['default'], function (done) {
var server;
server = new Server({
configFile: __dirname + '/karma.conf.js',
singleRun: true
});
server.start(function () {
done();
});
});
gulp.task('default', ['version']);