-
Notifications
You must be signed in to change notification settings - Fork 0
/
kacl.js
executable file
·40 lines (37 loc) · 971 Bytes
/
kacl.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
#!/usr/bin/env node
const chalk = require('chalk');
const { init, lint, release } = require('./src');
function run () {
switch (process.argv[2]) {
case 'init':
init();
break;
case 'lint':
lint();
break;
case 'prerelease':
lint(true);
break;
case 'release':
release();
break;
default:
console.log([
'Usage: kacl init|lint|prerelease|release',
'',
' init - Initializes a new CHANGELOG.md',
' lint - Lints your changelog for errors',
' prerelease - Checks the requirements for creating a new release (should be added to the "preversion" script)',
' release - Creates a new release matching your package.json version (should be added to the "version" script)',
'',
].join('\n'));
process.exit(2);
break;
}
}
try {
run();
} catch (err) {
console.error(chalk.red(err.message));
process.exit(1);
}