Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit c95ed09

Browse files
chriskchewchriskchew
authored andcommitted
Slightly improved output formatting.
1 parent d5b8881 commit c95ed09

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/scripts/jenkins.coffee

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,19 @@ jenkinsDescribe = (msg) ->
6363
try
6464
content = JSON.parse(body)
6565
response += "JOB: #{content.displayName}\n"
66-
response += "DESCRIPTION: #{content.description}\n"
66+
67+
if content.description
68+
response += "DESCRIPTION: #{content.description}\n"
69+
6770
response += "ENABLED: #{content.buildable}\n"
6871
response += "STATUS: #{content.color}\n"
72+
6973
tmpReport = ""
70-
for report in content.healthReport
71-
tmpReport += "\n #{report.description}"
74+
if content.healthReport.length > 0
75+
for report in content.healthReport
76+
tmpReport += "\n #{report.description}"
77+
else
78+
tmpReport = " unknown"
7279
response += "HEALTH: #{tmpReport}\n"
7380

7481
parameters = ""

0 commit comments

Comments
 (0)