From aad6b50d81954a8e22b53285122c5d436c972561 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Fri, 6 Mar 2026 22:19:40 -0800 Subject: [PATCH] make token script cross-platform (macOS, Linux, Windows) Co-Authored-By: Claude Opus 4.6 --- scripts/get-twitch-token.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/get-twitch-token.sh b/scripts/get-twitch-token.sh index 18a40fad..9f6eb193 100755 --- a/scripts/get-twitch-token.sh +++ b/scripts/get-twitch-token.sh @@ -46,7 +46,11 @@ REDIRECT_URI="https://twitch.tv/login" URL="https://id.twitch.tv/oauth2/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=${SCOPES}&force_verify=true" echo "Opening Twitch authorization in your browser..." -open "$URL" +case "$(uname -s)" in + MINGW*|MSYS*|CYGWIN*) start "$URL" ;; + Darwin*) open "$URL" ;; + *) xdg-open "$URL" ;; +esac echo "" echo "After authorizing, copy the full URL from the address bar and paste it here:" @@ -84,7 +88,11 @@ if [ -z "$TOKEN" ]; then exit 1 fi -echo "$TOKEN" | tr -d '\n' | pbcopy +case "$(uname -s)" in + MINGW*|MSYS*|CYGWIN*) echo "$TOKEN" | tr -d '\n' | clip ;; + Darwin*) echo "$TOKEN" | tr -d '\n' | pbcopy ;; + *) echo "$TOKEN" | tr -d '\n' | xclip -selection clipboard ;; +esac echo "Token copied to clipboard!" echo ""