-
Notifications
You must be signed in to change notification settings - Fork 5
/
make.js
43 lines (38 loc) · 989 Bytes
/
make.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
/**
* Module dependencies
*/
const commander = require('commander');
const fs = require('fs');
const packageMetadata = require('./package.json');
const ci = require('ci-build-tools')(process.env.GIT_TAG_PUSHER);
const version = ci.GetVersion();
commander.version(version);
/**
* Build
*/
commander
.command('build')
.description('Setup require build files for npm package.')
.action(() => {
packageMetadata.version = version;
fs.writeFile('./package.json', JSON.stringify(packageMetadata, null, 2), err => {
if (err) {
throw err;
}
});
console.log('Building package %s (%s)', packageMetadata.name, version);
console.log('');
});
/**
* After Build
*/
commander
.command('after_build')
.description('Publishes git tags and reports failures.')
.action(() => {
console.log('After build package %s (%s)', packageMetadata.name, version);
console.log('');
ci.PublishGitTag();
ci.MergeDownstream('release/', 'master');
});
commander.parse(process.argv);