-
Notifications
You must be signed in to change notification settings - Fork 4
/
bump.js
45 lines (35 loc) · 863 Bytes
/
bump.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
#!/usr/bin/env node
'use strict';
var multiline = require('multiline'),
program = require('commander'),
api = require('./index');
program
.version(require('./package').version)
.usage('[options]')
.option('--no-tags', 'Do not create git tag')
.option('--push', 'Push to remote repo');
['patch', 'minor', 'major'].forEach(function(type){
program.option('--' + type, 'Increase ' + type + ' version');
program.on(type, function(){
setTimeout(function(){
api.manifests().forEach(function(manifest){
api.bump(manifest, type);
});
if(program.tags){
api.tag(program.push);
}
}, 0);
});
});
program.on('--help', function(){
console.log(multiline(function(){/*
Usage:
$ bump --patch
$ bump --patch --no-tags
$ bump --info
*/}));
});
program.parse(process.argv);
if(program.rawArgs.length < 3){
program.help();
}