diff options
author | Teddy Wing | 2018-04-18 22:41:35 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-18 22:42:17 +0200 |
commit | bdf52d9daa06b1225f4bbe893a6049b5f2123426 (patch) | |
tree | 0012e6de345134ed05370804fae4dfe5e78da438 | |
parent | f62b3a760b2d7ed3001c43f3c00ae9efcb08bec9 (diff) | |
download | redprine-bdf52d9daa06b1225f4bbe893a6049b5f2123426.tar.bz2 |
cache_my_pull_requests(): Reuse `extract_data_from_pull_request_json`
Get rid of duplicated PR hash building and filtering code.
-rwxr-xr-x | redprine | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -38,20 +38,7 @@ function fetch_pull_requests () { function cache_my_pull_requests () { local pull_requests="$1" - local my_pull_requests=$( - printf "%s\n" "$pull_requests" | - jq '. | - map({ - html_url, - number, - user: .user.login, - ref: .head.ref, - created_at - }) | - map( - select(.user == "teddywing") - )' - ) + local my_pull_requests=$(extract_data_from_pull_request_json "$pull_requests") echo "$my_pull_requests" > "$CACHE_FILE" } |