Skip to content

Commit 242a683

Browse files
committed
mesage when nothing to review
1 parent 32b9c7a commit 242a683

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
logs/*.log
3+
gbot.yml

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@umbrellio/gbot",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"bin": "gbot",
55
"repository": "git@github.com:umbrellio/gbot.git",
66
"author": "Aleksei Bespalov <nulldefiner@gmail.com>",

tasks/unapproved.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,17 @@ class Unapproved extends BaseCommand {
2121
}
2222

2323
__buildMessage = requests => {
24-
const list = requests.map(this.__buildRequestDescription).join("\n")
25-
const head = `#### Hey, there is a couple of requests waiting for your review`
26-
27-
return `${head}\n\n${list}`
24+
if (requests.length) {
25+
const list = requests.map(this.__buildRequestDescription).join("\n")
26+
const head = `#### Hey, there is a couple of requests waiting for your review`
27+
28+
return `${head}\n\n${list}`
29+
} else {
30+
return [
31+
"#### Hey, there is a couple of nothing",
32+
"There are no pending requests! Let's do a new one!"
33+
].join("\n\n")
34+
}
2835
}
2936

3037
__buildRequestDescription = request => {

0 commit comments

Comments
 (0)