nextcloud-android/scripts/lib.sh
Andy Scherzinger c5b17f4de9
Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-03-29 17:33:39 +01:00

27 lines
572 B
Bash

#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2022 Álvaro Brey <alvaro@alvarobrey.com>
# SPDX-License-Identifier: GPL-3.0-or-later
#
## 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
}