1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

taskie: Updated backends to use common code.

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2017-06-29 14:11:22 +02:00
parent 70dbc4dc1d
commit cfad8b1576
6 changed files with 174 additions and 98 deletions

View file

@ -1,20 +0,0 @@
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;
}