adding data to gitea api call function

This commit is contained in:
Lucas Frérot 2024-12-28 22:55:15 +01:00
parent f06d537ffb
commit c229c9dd81
No known key found for this signature in database
GPG Key ID: 03B54A50E3FBA7E8
1 changed files with 10 additions and 2 deletions

12
rtenets
View File

@ -117,9 +117,17 @@ gitea() {
local method="$1" local method="$1"
local request="$2" local request="$2"
\curl -X "${request}" \ local data=""
if [[ $# > 3 ]]; then
data="$3"
fi
\curl -s -X "${request}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: token ${TOKEN}" "${ENDPOINT}/${method}" -H "Authorization: token ${TOKEN}" \
-d "${data}" \
"${ENDPOINT}/${method}"
} }
# ----------------- Git commands ----------------------- # ----------------- Git commands -----------------------