aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2025-08-18 15:39:09 -0700
committerCaroline Larimore <caroline@larimo.re>2025-08-18 15:45:53 -0700
commit696be76bda4c8bf8ed0fc7d0cff2c1358f98aa93 (patch)
treebf27d4be4475a54fdc43e1b8bdbfae5171c42d50
parent5fbe4e8fbbbb5da0b364d458a77925a5f89264e5 (diff)
fix: create auth.json if missing
-rwxr-xr-xmcsh.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/mcsh.sh b/mcsh.sh
index 18b0995..b14f897 100755
--- a/mcsh.sh
+++ b/mcsh.sh
@@ -16,6 +16,10 @@ function auth (
XSTS_TOKEN_URL="https://xsts.auth.xboxlive.com/xsts/authorize"
MC_AUTH_URL="https://api.minecraftservices.com/authentication/login_with_xbox"
+ if ! [[ -e auth.json ]]; then
+ printf '{}\n' > auth.json
+ fi
+
function login (
printf 'getting device code\n' >&2
res="$(curl -s -X POST "$DEVICE_CODE_URL" -H 'Content-Type: application/x-www-form-urlencoded' -d "client_id=$CLIENT_ID&scope=XboxLive.signin%20offline_access")"