mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
taskie: Added initial version.
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
613ef65f67
commit
73f634318f
6 changed files with 240 additions and 1 deletions
20
inc/taskie/backend.utils.inc.sh
Normal file
20
inc/taskie/backend.utils.inc.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue