-
Notifications
You must be signed in to change notification settings - Fork 317
Expand file tree
/
Copy pathgren.js
More file actions
24 lines (19 loc) · 731 Bytes
/
gren.js
File metadata and controls
24 lines (19 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env node
import gren from 'commander';
import { version, description } from '../package.json';
const argvWithVersion = argvs => {
const vPos = argvs.indexOf('-v');
if (vPos > -1) {
argvs[vPos] = '-V';
}
return argvs;
};
gren
.version(version)
.description(`gren (🤖 ) ${description}`)
.usage('<command> [options]')
.command('init', 'Initialise the module options').alias('i')
.command('release', 'Generate release notes and attach them to a tag').alias('r')
.command('changelog', 'Create a CHANGELOG.md file, based on release notes').alias('c')
.command('examples', 'Show few examples of stuff that you can do <cmd>')
.parse(argvWithVersion(process.argv));