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

Commit 25a423a

Browse files
Merge pull request #1275 from bhcleek/fix-teamcity-builds-reporting
fix tc list builds reporting
2 parents a4d22b2 + 71edaac commit 25a423a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/scripts/teamcity.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ module.exports = (robot) ->
4343

4444
getBuildType = (msg, type, callback) ->
4545
url = "#{base_url}/httpAuth/app/rest/buildTypes/#{type}"
46-
console.log "sending request to #{url}"
4746
msg.http(url)
4847
.headers(getAuthHeader())
4948
.get() (err, res, body) ->
@@ -96,7 +95,7 @@ module.exports = (robot) ->
9695
.query(locator: ["count:#{amount}","running:any"].join(","))
9796
.get() (err, res, body) ->
9897
err = body unless res.statusCode == 200
99-
builds = JSON.parse(body).build.splice(amount) unless err
98+
builds = JSON.parse(body).build unless err
10099
callback err, msg, builds
101100

102101
mapNameToIdForBuildType = (msg, project, name, callback) ->
@@ -254,9 +253,8 @@ module.exports = (robot) ->
254253
configuration = buildTypeMatches[1]
255254
project = null
256255

257-
258256
getBuilds msg, project, configuration, amount, (err, msg, builds) ->
259-
if not builds
257+
if not builds || builds.length == 0
260258
msg.send "Could not find builds for #{option}"
261259
return
262260
createAndPublishBuildMap(builds, msg)

0 commit comments

Comments
 (0)