-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
26 lines (25 loc) · 825 Bytes
/
cli.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
#!/usr/bin/env node
const argv = require('yargs')
.demandOption(['gh-token', 'owner', 'repo'])
.option('branch', {
description: 'release branch name',
type: 'string',
demandOption: true
})
.option('tag', {
description: 'create release branch based from a tag, if option not passed, it takes the highest tag automatically', // eslint-disable-line max-len
type: 'string'
})
.help(false)
.version(false)
.argv
const run = require('./index')
run(argv)
.then((response) => {
console.log(`The release branch ${response.url} has been created sucessfully.`) // eslint-disable-line max-len
console.log(`Pull Request ${response.pullRequest.html_url} has been created sucessfully.`) // eslint-disable-line max-len
})
.catch((e) => {
console.log(e.message)
process.exit(1)
})