Skip to content

Commit 25e0566

Browse files
wip
Signed-off-by: tobiasKaminsky <[email protected]>
1 parent ff37759 commit 25e0566

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

scripts/lib.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Nextcloud Android Library
4+
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
5+
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
6+
# SPDX-License-Identifier: MIT
7+
8+
## This file is intended to be sourced by other scripts
9+
10+
11+
function err() {
12+
echo >&2 "$@"
13+
}
14+
15+
16+
function curl_gh() {
17+
if [[ -n "$GITHUB_TOKEN" ]]
18+
then
19+
curl \
20+
--silent \
21+
--header "Authorization: token $GITHUB_TOKEN" \
22+
"$@"
23+
else
24+
err "WARNING: No GITHUB_TOKEN found. Skipping API call"
25+
fi
26+
27+
}

0 commit comments

Comments
 (0)