From e9e916eba16c23d26c9b4ca9ac95a4d302154bd4 Mon Sep 17 00:00:00 2001 From: Danny Wahl Date: Fri, 12 Jul 2019 22:09:07 -0600 Subject: [PATCH] replace python with jq --- studio/studio | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/studio/studio b/studio/studio index 613a087..74546b5 100755 --- a/studio/studio +++ b/studio/studio @@ -130,12 +130,12 @@ if [ $? -gt 0 ]; then printf >&2 "Unable to generate a session. Please ensure that your credentials are accurate.\r\n" exit 2 fi -token=$(echo "$session" | python -c 'import sys, json; print json.load(sys.stdin)["session"]["token"]') +token=$(echo "$session" | jq -r .session.token) if [ $? -gt 0 ]; then printf >&2 "Unable to find session token.\r\n" exit 2 fi -userid=$(echo "$session" | python -c 'import sys, json; print json.load(sys.stdin)["session"]["user"]["id"]') +userid=$(echo "$session" | [jq -r .session.user.id) if [ $? -gt 0 ]; then printf >&2 "Unable to find session userid.\r\n" exit 2