TwitchDownloader/docker/entrypoint.sh
MaddoScientisto 4083fb4d78
All checks were successful
Publish Twitch Archive Container / publish (push) Successful in 1m29s
Add support for CLIENT-ID, CLIENT-SECRET, and OAUTH-PRIVATE-TOKEN environment variables
Co-authored-by: Copilot <copilot@github.com>
2026-04-25 17:04:44 +02:00

27 lines
No EOL
761 B
Bash

#!/bin/sh
set -eu
mkdir -p /app/archive /app/config /app/bin/temp
if [ -z "${CLIENT_ID:-}" ]; then
client_id_from_hyphenated="$(printenv 'CLIENT-ID' 2>/dev/null || true)"
if [ -n "$client_id_from_hyphenated" ]; then
export CLIENT_ID="$client_id_from_hyphenated"
fi
fi
if [ -z "${CLIENT_SECRET:-}" ]; then
client_secret_from_hyphenated="$(printenv 'CLIENT-SECRET' 2>/dev/null || true)"
if [ -n "$client_secret_from_hyphenated" ]; then
export CLIENT_SECRET="$client_secret_from_hyphenated"
fi
fi
if [ -z "${OAUTH_PRIVATE_TOKEN:-}" ]; then
oauth_token_from_hyphenated="$(printenv 'OAUTH-PRIVATE-TOKEN' 2>/dev/null || true)"
if [ -n "$oauth_token_from_hyphenated" ]; then
export OAUTH_PRIVATE_TOKEN="$oauth_token_from_hyphenated"
fi
fi
exec "$@"