1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | pullRequests = require './libs/bitbucket'
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | ensureConfig = (out) ->
|
21 | out "Error: BitBucket Auth username is not specified" if not process.env.HUBOT_BITBUCKET_AUTH_USER
|
22 | out "Error: BitBucket Auth password is not specified" if not process.env.HUBOT_BITBUCKET_AUTH_PASS
|
23 | out "Error: BitBucket repositories list is not specified" if not process.env.HUBOT_BITBUCKET_REPOSITORIES
|
24 | return false unless (process.env.HUBOT_BITBUCKET_AUTH_USER and process.env.HUBOT_BITBUCKET_AUTH_PASS and process.env.HUBOT_BITBUCKET_REPOSITORIES)
|
25 | true
|
26 |
|
27 | module.exports = (robot) ->
|
28 | ensureConfig console.log
|
29 |
|
30 | robot.respond /list (\w.+) pull-requests/i, (msg) ->
|
31 | pullRequests.summary msg, msg.match[1]
|
32 |
|
33 | robot.respond /list pull-requests/, (msg) ->
|
34 | pullRequests.summary msg
|