-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdatefile.js
More file actions
44 lines (39 loc) · 1.2 KB
/
updatefile.js
File metadata and controls
44 lines (39 loc) · 1.2 KB
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
'use strict';
var isValid = require('is-valid-app');
var middleware = require('./lib/middleware');
var utils = require('./lib/utils');
module.exports = function(app) {
if (!isValid(app, 'updater-verb')) return;
app.task('verb', function() {
var verbmd = app.options.verbmd || '.verb*.md';
var filename = app.options.file || '.verb.md';
return app.src(verbmd)
.pipe(utils.through.obj(function(file, enc, next) {
utils.del(file.path, function(err, files) {
if (err) {
next(err);
return;
}
if (file.basename !== filename && app.options.silent !== true) {
app.log.success('renamed', file.relative);
}
file.basename = filename;
next(null, file);
});
}))
.pipe(utils.series([
middleware.lintDeps,
middleware.htmlComments,
middleware.install,
middleware.related(app.base),
middleware.reflinks(app.base),
middleware.travis(app.base),
middleware.jscomments,
middleware.license,
middleware.whitespace,
middleware.toGithubUrl
]))
.pipe(app.dest(app.cwd));
});
app.task('default', ['verb']);
};