aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xredprine10
1 files changed, 6 insertions, 4 deletions
diff --git a/redprine b/redprine
index a9b89eb..2c2d055 100755
--- a/redprine
+++ b/redprine
@@ -170,13 +170,15 @@ function update_redmine_status () {
if [ "$status_code" != '200' ]; then
exit_with_error "Redmine API error, status code $status_code"
fi
+
+ update_cache_with_new_pull "$pull_request"
}
-# Updates the cache file appending new pull requests in our JSON format.
-function update_cache_with_new_pulls () {
- local new_pull_requests="$1"
+# Updates the cache file, appending a new pull request in our JSON format.
+function update_cache_with_new_pull () {
+ local pull_request="$1"
- jq "$new_pull_requests" "$CACHE_FILE" > "${CACHE_FILE}.new"
+ jq "[$pull_request] + ." "$CACHE_FILE" > "${CACHE_FILE}.new"
mv "${CACHE_FILE}.new" "$CACHE_FILE"
}