Skip to content

Commit 686dac1

Browse files
authored
Don't use planetscale org unless explicitly set
1 parent cdef97a commit 686dac1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11

22
# Set DB_NAME unless it is already set
3-
export DB_NAME=${DB_NAME:-example-db-${GITHUB_USER}}
3+
export DB_NAME=${DB_NAME:-harry-potter-${GITHUB_USER:-db}}
44
echo "Using DB name ${DB_NAME}"
55

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 and name of the org
9+
# check exit code
1010
if [ $? -ne 0 ] || [ -z "${ORG_NAME}" ]; then
1111
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
14+
# if org name is set to planetscale, we will set org name to planetscale-demo instead
15+
if [ "${ORG_NAME}" = "planetscale" ]; then
16+
export ORG_NAME="planetscale-demo"
17+
fi
1418
fi
19+
1520
echo "Using org name ${ORG_NAME}"
1621

1722
export BRANCH_NAME=${BRANCH_NAME:-"main"}

0 commit comments

Comments
 (0)