Skip to content

Commit b1eac03

Browse files
authored
Merge pull request #16 from jonico/auto-org-trouble-trouble-shooting
Descriptive error if org cannot be determined
2 parents b09593d + ad8bc1b commit b1eac03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.pscale/cli-helper-scripts/set-db-and-org-and-branch-name.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ echo "Using DB name ${DB_NAME}"
66
# set org name to first org the user has access to unless it is already set in ORG_NAME
77
if [ -z "${ORG_NAME}" ]; then
88
export ORG_NAME=`pscale org list --format json | jq -r ".[0].name"`
9-
# check exit code
10-
if [ $? -ne 0 ]; then
11-
echo "Error: Failed to get PlanetScale org name"
9+
# check exit code and name of the org
10+
if [ $? -ne 0 ] || [ -z "${ORG_NAME}" ]; then
11+
echo "Error: Failed to get PlanetScale org name, please set ORG_NAME explicitly or use Web based SSO, service tokens do not allow to list orgs."
1212
exit 1
1313
fi
1414
fi

0 commit comments

Comments
 (0)