-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
85 lines (71 loc) · 1.97 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
'use strict';
const gulp = require('gulp');
const gat = require('gulp-all-tasks')();
const exec = require('child_process').exec;
const opn = require('opn');
const config = {
repo: 'https://github.com/luminous-software/extensibility-logs.git',
remote: 'github',
branch: 'master',
folder: 'site',
push: 'false',
force: 'false',
user: {
email: '[email protected]',
name: 'Yann Duran'
},
address: '127.0.0.1',
port: '8006'
};
const consts = {
address: config.address + ':' + config.port
};
const options = {
pretty_format: ' --pretty=format:" * %s"'
};
const script = {
generate: 'mkdocs build',
serve: 'mkdocs serve --dev-addr=' + consts.address,
log: 'echo. && git log HEAD' + options.pretty_format,
changes: 'echo. && git log -n 1 HEAD' + options.pretty_format,
features: 'echo. && git log HEAD --grep="^feat" --no-merges' + options.pretty_format
};
gulp.task('log', function (cb) {
exec(script.log, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('changes', function (cb) {
exec(script.changes, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('features', function (cb) {
exec(script.features, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('generate', function (cb) {
exec(script.generate, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
});
gulp.task('serve', function (cb) {
const address = config.address + ':' + config.port;
gulp_util.log(address);
exec(script.serve, function (err, stdout, stderr) {
gulp_util.log(stdout);
gulp_util.log(stderr);
cb(err);
});
opn('http://' + address);
});
//gulp.task('default', ['serve']);