From 07d1404be9e2af0fb993c594853b60026f5cfbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Fri, 14 Aug 2026 12:25:51 +0200 Subject: [PATCH] fix icloud auth script --- scripts/icloud-auth.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/icloud-auth.sh b/scripts/icloud-auth.sh index efed126..bc5ca9b 100644 --- a/scripts/icloud-auth.sh +++ b/scripts/icloud-auth.sh @@ -12,15 +12,21 @@ if [[ ! -f "$ENV_FILE" ]]; then exit 1 fi -# shellcheck disable=SC1090 -source "$ENV_FILE" +get_env_value() { + local key="$1" -if [[ -z "${ICLOUD_EMAIL:-}" ]]; then + sed -n "s/^${key}=//p" "$ENV_FILE" | head -n 1 +} + +ICLOUD_EMAIL="$(get_env_value ICLOUD_EMAIL)" +ICLOUD_PASSWORD="$(get_env_value ICLOUD_PASSWORD)" + +if [[ -z "$ICLOUD_EMAIL" ]]; then echo "ERROR: ICLOUD_EMAIL is not configured." exit 1 fi -if [[ -z "${ICLOUD_PASSWORD:-}" ]]; then +if [[ -z "$ICLOUD_PASSWORD" ]]; then echo "ERROR: ICLOUD_PASSWORD is not configured." exit 1 fi