1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00
nux-env/inc/taskie/backend.utils.inc.sh
Tony Tkacik 73f634318f taskie: Added initial version.
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
2017-06-21 10:50:27 +02:00

20 lines
577 B
Bash

backend.githublike.get() {
local api=$1;
local append_next="$2";
nux.log debug Repository is $gogs_repository, message is $message
nux.log debug API call: $api Payload: $payload
header_tmp=$(mktemp);
while [ -n "$api" ];
do
curl $CURL_ADDITIONAL_ARGS -s -D "$header_tmp" -H "Content-Type: application/json" "$api"
next=$(grep "Link: " "$header_tmp" | tr "," "\n" | grep rel=\"next\" | cut -d"<" -f2 | cut -d">" -f1)
nux.log debug Next "$next";
if [ -n "$next" ]; then
api="${next}${append_next}"
else
api=""
fi
done;
rm -f $header_tmp;
}