1
0
Fork 0
mirror of https://github.com/nextcloud/android.git synced 2024-12-21 08:24:08 +03:00
nextcloud-android/scripts/lib.sh

28 lines
589 B
Bash
Raw Normal View History

#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2022 Álvaro Brey <alvaro@alvarobrey.com>
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
#
## This file is intended to be sourced by other scripts
function err() {
echo >&2 "$@"
}
function curl_gh() {
if [[ -n "$GITHUB_TOKEN" ]]
then
curl \
--silent \
--header "Authorization: token $GITHUB_TOKEN" \
"$@"
else
err "WARNING: No GITHUB_TOKEN found. Skipping API call"
fi
}