From 7f3bb5e9041b1654cd3a4dd705c92c0918b27265 Mon Sep 17 00:00:00 2001 From: loddit Date: Sun, 16 Aug 2015 15:45:22 +0800 Subject: [PATCH] format string for better readability --- legilimens.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/legilimens.coffee b/legilimens.coffee index 4200ae0..e415c95 100644 --- a/legilimens.coffee +++ b/legilimens.coffee @@ -28,7 +28,10 @@ getClosedPullRequestsAfter = (time) -> else pullRequests = JSON.parse(body).filter (pullRequest) -> new Date(pullRequest.merged_at) > time - printPullRequestsReport(pullRequests) + if pullRequests.length + printPullRequestsReport(pullRequests) + else + console.log 'No new pull requests be merged.' getLastedReleaseTime = new Promise (resolve, reject) -> callGithubAPI (repoUrl + LATEST_RELEASE_PATH), (error, response, body) -> @@ -36,7 +39,7 @@ getLastedReleaseTime = new Promise (resolve, reject) -> reject error else lastedReleaseTime = new Date(JSON.parse(body).created_at) - console.log lastedReleaseTime + console.log "Last release time is #{lastedReleaseTime.toLocaleTimeString()} #{lastedReleaseTime.toLocaleDateString()}" resolve(lastedReleaseTime) printPullRequestsReport = (pullRequests) ->