-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
generator.js
39 lines (33 loc) · 882 Bytes
/
generator.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
'use strict';
var path = require('path');
var isValid = require('is-valid-app');
module.exports = function(app) {
// returns false if `app` if generator is already registered
if (!isValid(app, 'generate-travis')) return;
/**
* Generate a `.travis.yml` file to the current working directory.
*
* ```sh
* $ gen travis
* ```
* @name travis
* @api public
*/
app.task('travis', { silent: true }, function(cb) {
return app.src('_travis.yml', {cwd: path.resolve(__dirname, 'templates')})
.pipe(app.dest(function(file) {
file.basename = '.travis.yml';
return app.cwd;
}));
});
/**
* The default task is an alias that enables Generate's CLI to run the [travis](#travis)
* task with the following command:
*
* ```sh
* $ gen travis
* ```
* @name default
*/
app.task('default', ['travis']);
};